Optional
nodes: number | unknown[]Number of nodes or values of nodes
Optional
edges: (Edges
Edges
Nodes
Number of nodes
Number of edges
Optional
s: numberOptional
t: anyAdd the edge.
Index of the starting node of the edge
Index of the end node of the edge
Optional
value: unknownValue of the edge
Optional
direct: booleantrue
if the edge is direct
Add the node.
Optional
value: unknownValue of the node
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
Returns adjacency list
Optional
direct: "in" | "out" | "both"Indegree or outdegree
Adjacency list
Returns adjacency matrix
Adjacency matrix
Returns indexes of articulation (cut) nodes.
Indexes of articulation nodes
Returns indexes of articulation (cut) nodes with checking each node.
Indexes of articulation nodes
Returns indexes of articulation (cut) nodes with checking lowlinks.
Indexes of articulation nodes
Returns indexes of each biconnected components.
Indexes of each biconnected components
Returns bisection cut.
Cut value and subset nodes
Returns edges of bridge.
Bridge edges
Returns edges of bridge with checking lowlinks.
Bridge edges
Returns indexes of center of this graph.
Indexes of center
Returns chromatic index of this graph.
Chromatic index
Returns chromatic number of this graph.
Chromatic number
Returns chromatic number of this graph with Welch-Powell algorithm.
Chromatic number
Remove all edges.
Remove all nodes.
Cleave the node.
Index of node
Returns index of all cliques.
Index of cliques
Returns index of cliques.
Size of clique
Index of cliques
Returns indexes of each components.
Indexes of each components
Contract this graph.
Index of node
Index of node
Returns cut size.
Subset
Subset
Cut size
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 degree matrix.
Optional
direct: "in" | "out" | "both"Indegree or outdegree
Degree matrix
Returns diameter of this graph.
Diameter
Returns eccentricity at k of this graph.
Index of target node
Eccentricity
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 the node value.
Index of the node
Node value
Returns the node value.
Optional
k: number[]Index of the node
Node value
Returns girth of this graph.
Girth
Returns Hamiltonian cycle
Hamiltonian cycle
Returns Hamiltonian path
Optional
from: numberIndex of start node
Hamiltonian path
Returns Hamiltonian path with dynamic programming
Optional
from: numberIndex of start node
Hamiltonian path
Returns if this has cycle or not.
true
if this has cycle
Returns if this has cycle or not with depth-first search.
true
if this has cycle
Returns if this has cycle or not with checking each node.
true
if this has cycle
Returns if this is biconnected graph or not.
true
if this is biconnected graph
Returns if this is bipartite graph or not.
true
if this is bipartite graph
Returns if this is complete graph or not.
true
if this is complete graph
Returns if this is connected graph or not.
true
if this is connected graph
Returns if this is directed acyclic graph or not.
true
if this is directed acyclic graph
Returns if this is directed graph or not.
true
if this is directed graph
Returns if this is edgeless graph or not.
true
if this is edgeless graph
Returns if this is Eulerian graph or not.
true
if this is Eulerian graph
Returns if this is forest or not.
true
if this is forest
Returns if this is Hamiltonian graph or not.
true
if this is Hamiltonian graph
Returns if this is mixed graph or not.
true
if this is mixed graph
Returns if this is null graph or not.
true
if this is null graph
Returns (sub) graph isomorphism maps from 'g' to this (sub) graph.
Other graph
Isomorphism maps from 'g' to this (sub) graph
Returns (sub) graph isomorphism maps from 'g' to this (sub) graph with Ullmann algorithm.
Other graph
Isomorphism maps from 'g' to this (sub) graph
Returns (sub) graph isomorphism maps from 'g' to this (sub) graph with VF2 algorithm.
Other graph
Isomorphism maps from 'g' to this (sub) graph
Returns if this is oriented graph or not.
true
if this is oriented graph
Returns if this is plainer graph or not.
true
if this is plainer graph
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
Returns if this is regular graph or not.
Optional
n: numberDegree of vertices
true
if this is regular graph
Returns if this is semi-Eulerian graph or not.
true
if this is semi-Eulerian graph
Returns if this is semi-Hamiltonian graph or not.
true
if this is semi-Hamiltonian graph
Returns if this is separable graph or not.
true
if this is separable graph
Returns if this is simple graph or not.
true
if this is simple graph
Returns if this is symmetric graph or not.
true
if this is symmetric graph
Returns if this is tree or not.
true
if this is tree
Returns if this is undirected graph or not.
true
if this is undirected graph
Returns if this is weighted graph or not.
true
if this is weighted graph
Returns laplacian matrix.
Laplacian matrix
Returns minimum cut.
Optional
minv: numberMinimum number for subset
Cut value and subset nodes
Returns minimum cut.
Optional
minv: numberMinimum number for subset
Cut value and subset nodes
Returns minimum cut.
Optional
minv: numberMinimum number for subset
Optional
trials: numberTrial count
Cut value and subset nodes
Returns minimum cut.
Optional
minv: numberMinimum number for subset
Optional
trials: numberTrial count
Cut value and subset nodes
Returns minimum cut.
Optional
minv: numberMinimum number for subset
Optional
startnode: numberStart node index
Cut value and subset nodes
Returns radius of this graph.
Radius
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.
Remove the node.
Index of the node
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
Returns shortest path with Bellman–Ford algorithm.
Index of start node
Shortest length and path for all nodes
Returns shortest path with breadth first search algorithm.
Index of start node
Shortest length and path for all nodes
Returns shortest path with Dijkstra's algorithm.
Index of start node
Shortest length and path for all nodes
Returns shortest path with Floyd–Warshall algorithm.
Shortest length and path for all nodes
Subdivision this graph.
Index of node
Index of node
Substitute other graph at the node.
Index of the node
Other graph
Returns a string of DOT format.
String of DOT format
Returns a string represented this graph.
String represented this graph
Static
completeStatic
completeReturns complete bipartite graph.
Size of the first group
Size of the second group
Complete bipartite graph
Static
cycleReturns cycle graph.
Size of the graph
Optional
direct: booleanDirect graph or not
Cycle graph
Static
fromReturns graph from adjacency matrix.
Adjacency matrix
Graph from adjacency matrix
Static
fromReturns named graph
Name of the graph
Named graph
Static
wheelStatic
windmillReturns windmill graph.
Size of the sub complete graph
Number of the sub complete graph
Windmill graph
Graph class