Optional
nodes: number | unknown[]Number of nodes or values of nodes
Optional
edges: (Edges
Edges
Nodes
Number of nodes
Number of edges
Return indexes of adjacency nodes.
Index of target node
Optional
undirect: booleanCheck undirected edges
Optional
direct: boolean | "in" | "out"Check directed edges
Indexes of adjacency nodes
Return indexes of adjacency nodes.
Index of target node
Check only directed edges
Indexes of adjacency nodes
Return degree of the node.
Index of target node
Optional
undirect: booleanCount undirected edges
Optional
direct: boolean | "in" | "out"Count directed edges
Degree of the node
Return degree of the node.
Index of target node
Count only directed edges.
Degree of the node
Returns the edges.
Index of the starting node of the edge
Index of the end node of the edge
Optional
undirect: booleanGet undirected edges or not
Optional
direct: boolean | "forward" | "backward"Get directed edges or not
Edges between from
and to
Returns the edges.
Index of the starting node of the edge
Index of the end node of the edge
Get only directed edges
Edges between from
and to
Returns if this is plainer graph or not with add-path algorithm.
On the Cutting Edge: Simplified O(n) Planarity by Edge Addition https://xuzijian629.hatenablog.com/entry/2019/12/14/163726
true
if this is plainer graph
Returns if this is plainer graph or not with add-vertex algorithm.
Hopcroft, J. and Tarjan, R. "Efficient Planarity Testing", J. ACM, Vol. 21, No. 4, pp. 549-568 (1974) 西関 隆夫. "32. グラフの平面性判定法", 情報処理, Vol. 24, No. 4, pp. 521-528 (1983) K. S. Booth, "Testing for the Consecutive Ones Property, Interval Graphs, and Graph Planarity Using PQ-Tree Algorithms", Journal of computer and system sciences, 13, pp. 335-379 (1976)
true
if this is plainer graph
Remove the edges.
Index of the starting node of the edge
Index of the end node of the edge
Optional
direct: booleannull
to remove direct and undirect edges, true
to remove only direct edges, false
to remove only undirect edges.
Returns shortest path.
Optional
from: nullIndex of start nodes
Shortest length and path for all nodes
Returns shortest path.
Index of start nodes
Shortest length and path for all nodes
Static
completeStatic
completeStatic
cycleStatic
fromStatic
fromReturns named graph
Name of the graph
Named graph
Static
wheelStatic
windmill
Graph class