Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5e27443

Browse files
authored
adding documentation for graph structure
1 parent e8c075b commit 5e27443

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

‎README.md‎

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,34 @@ Legend:
1616
* Two vertices are called adjacent if they are connected by an edge.
1717
* Two edges are called incident, if they share a vertex.
1818

19+
## Basic Graph
20+
21+
![Graph Structure](doc/graph.jpg)
22+
23+
```cpp
24+
class bNode {
25+
private:
26+
string name_; // node name
27+
set<const bEdge*, edgeCompare> edgelist_; // incident list
28+
...
29+
}/
30+
class bEdge {
31+
private:
32+
const bNode* n1_; // from node for directd graphs
33+
const bNode* n2_; // to node for directed graphs
34+
...
35+
};
36+
...
37+
class bGraph {
38+
private:
39+
bool isDirected_;
40+
set<const bNode*, nodeCompare> nodeset_;
41+
set<const bEdge*, edgeCompare> edgeset_;
42+
...
43+
};
44+
45+
```
46+
1947
## Algorithms Covered
2048
2149
* [DFS](src/dfs.h)
@@ -36,7 +64,7 @@ graph (un)directed`
3664
3765
***Example Graph File***
3866
39-
![](https://github.com/srohit0/BasicGraphAlgorithmsCpp/blob/master/docs/ExampleGraph.JPG)
67+
![Example Graph](docs/ExampleGraph.JPG)
4068
4169
```
4270
# Comment, ignored by the graph reader

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /