Topological Property of Nodes
Nodes connected to the graph connect with edges to form a topological relation. Nodes in the topological graph contains information about edges connected to it, and all edge conditions among two points.
- #edgeCount - Quantity of edges connected to this node
- #forEachEdge() - Traverse all edges connected to this node
- #forEachInEdge() - Traverse all edges connected into this node
- #forEachOutEdge() - Traverse all edges connected from this node
- #getEdgeBundle(node) - Acquire edge collection between appointed node and this node
Example
Create two nodes and three edges to acquire the edge count between two nodes
var a = graph.createNode('A');
var b = graph.createNode('B');
graph.createEdge(a, b);
graph.createEdge(a, b);
graph.createEdge(a, b);
alert(a.getEdgeBundle(b).edges.length);
The operation result indicates “3”