Graphs¶
-
Graph
(edges)¶ -
Graph
(vertices, edges) construct a graph
-
Vertices
(g)¶ return list of graph vertices
-
Edges
(g)¶ return list of graph edges
See also
-
AdjacencyList
(g)¶ adjacency list
- Param g
graph
Return adjacency list of graph
g
.See also
-
AdjacencyMatrix
(g)¶ adjacency matrix
- Param g
graph
Return adjacency matrix of graph
g
.See also
-
BFS
(g, f)¶ -
BFS
(g, v, f) traverse graph in breadth-first order
Traverse graph
g
in breadth-first order, starting fromv
if provided, or from the first vertex.f
is called for every visited vertex.
-
DFS
(g, f)¶ -
DFS
(g, v, f) traverse graph in depth-first order
Traverse graph
g
in depth-first order, starting fromv
if provided, or from the first vertex.f
is called for every visited vertex.