net
Creates a graph-theory network with n vertices (undirected by default, or directed).
n(number) -- number of verticesdirected(boolean) -- optional, defaults to false
Creates a graph-theory network with n vertices (undirected by default, or directed).
n (number) -- number of verticesdirected (boolean) -- optional, defaults to falseAdds an edge between two vertices, addressed by 0-based index (unweighted by default, or with an explicit weight).
g (network) -- u (number) -- vertex indexv (number) -- vertex indexweight (number) -- optional, defaults to 1.0Places a vertex at explicit (x, y) coordinates, required before dijkstra() can trace the graph.
g (network) -- i (number) -- vertex indexx (number) -- y (number) -- Traces Dijkstra's shortest-path algorithm from a source vertex, optionally to a destination, producing a step-by-step event trace for visualization. Every vertex must already have an explicit position via node().
g (network) -- src (number) -- source vertex indexdst (number) -- optional destination vertex indexBreadth-first search order from a start vertex.
g (network) -- src (integer) -- Depth-first search order from a start vertex.
g (network) -- src (integer) -- Shortest distances from a start vertex to every vertex (Dijkstra; inf where unreachable).
g (network) -- src (integer) -- The vertices of a shortest path from src to dst, in order.
g (network) -- src (integer) -- dst (integer) -- Shortest distances and predecessors from a start vertex, allowing negative edge weights (an error on a negative cycle).
g (network) -- src (integer) -- A minimum spanning tree's edges (Prim's algorithm).
g (network) -- A minimum spanning tree's edges (Kruskal's algorithm).
g (network) -- An order of the vertices of a directed acyclic graph in which every edge points forward.
g (network) -- directedThe connected components, each as a list of vertices.
g (network) -- True if every vertex can reach every other.
g (network) -- True if the graph contains a cycle.
g (network) -- True if the vertices split into two groups with every edge between the groups.
g (network) -- The number of vertices.
g (network) -- The number of edges.
g (network) -- The vertices joined to v by an edge.
g (network) -- v (integer) -- True if there is an edge from u to v.
g (network) -- u (integer) -- v (integer) -- The weight of the edge from u to v, or text if there is none.
g (network) -- u (integer) -- v (integer) -- The adjacency matrix: edge weights (1 when unweighted), 0 on the diagonal, inf where there is no edge.
g (network) --