|
| 1 | +TERMINOLOGY |
| 2 | +*********** |
| 3 | +Network / Graph A set of nodes connected by links |
| 4 | +Node / Vertex A spot in a network |
| 5 | +Link / Edge Connects nodes, can be either directed or indirected |
| 6 | +Path A sequence of nodes and links |
| 7 | +Cycle / Loop A path that returns to its starting point |
| 8 | +Reachable B is reachable from A if there is a path from A to B |
| 9 | +Connected Nodes A and B are connected if B is reachable from A and vice versa |
| 10 | +Undirected A graph is connected if every node is connected to every other node |
| 11 | +Strongly Connected If every node in a graph is reachable from every other node |
| 12 | +Weakly Connected A directed network becomes connected when you replace its links with undirected links |
| 13 | +Adjacent Nodes are connected by a link |
| 14 | +Neighbor An adjacent node |
| 15 | + |
| 16 | +Example; |
| 17 | + |
| 18 | +A ---- 75 ----> B |
| 19 | + |
| 20 | +Node A and Node B are connected by a link so they are adjacent nodes. |
| 21 | +Node B is Node A's neighbor because there is a directed link from Node A |
| 22 | +to Node B however, Node A is not neighbor of Node B because there is not a |
| 23 | +backward directed link from Node B to Node A. If the graph was undirected, |
| 24 | +then both Nodes would be neighbors of each other. |
| 25 | + |
| 26 | +Degree In an undirected network, he number of links a node has is called Degree. |
| 27 | +In-Degree In a directed network, the number of links entering a node is called In-Degree. |
| 28 | +Out-Degree Same as In-Degree but Out-Degree is the number of links leaving the node. |
| 29 | + |
| 30 | + |
| 31 | +NETWORK REPRESENTATION |
| 32 | +********************** |
| 33 | +You can save network in a text file in order to reuse it. Check out following directed graph; |
| 34 | + |
| 35 | + A |
| 36 | + / \ |
| 37 | + / \ |
| 38 | + 10 15 |
| 39 | + / \ |
| 40 | +|/_ _\| |
| 41 | + |
| 42 | +B --- 12 --> C |
| 43 | + \ / |
| 44 | + \ / |
| 45 | + 16 13 |
| 46 | + \ / |
| 47 | + _\|/_ |
| 48 | + D |
| 49 | + |
| 50 | +To save it to a text file, you can use following format; |
| 51 | + |
| 52 | +nodeLabel, toNode#1, cost#1, toNode#2, cost#2,... toNode#N, cost#N |
| 53 | + |
| 54 | +So, the text representation will be as follows; |
| 55 | + |
| 56 | +A, B, 10, C, 15 |
| 57 | +B, C, 12, D, 16 |
| 58 | +C, D, 13 |
| 59 | +D |
| 60 | + |
| 61 | +Other Representations; |
| 62 | +********************** |
| 63 | +XML |
| 64 | +JSON |
0 commit comments