depth_first_search¶
- mdhelper.algorithm.utility.depth_first_search(graph: dict[Any, list[Any]], start: Any, visited: bool, group: list[Any]) None [source]¶
Implements the depth-first search algorithm to find connected components in a graph.
- Parameters:
- graphdict
Graph to search.
- startAny
Starting node.
- visiteddict
Visited nodes. This dict is updated in-place.
- grouplist
Connected nodes. This list is updated in-place.