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
gin breadth-first order, starting fromvif provided, or from the first vertex.fis called for every visited vertex.
-
DFS(g, f)¶ -
DFS(g, v, f) traverse graph in depth-first order
Traverse graph
gin depth-first order, starting fromvif provided, or from the first vertex.fis called for every visited vertex.