Skip to content

breadth_first_search

BreadthFirstSearch

Bases: NKAlgorithm

An algorithm using the networkit implementation of Breadth-First Search. This algorithm finds a path between the source and target node.

source = source instance-attribute

target = target instance-attribute

__init__(graph, source, target)

run()

Compute the path between the source and target node of the given graph.

Returns:

Type Description
ndarray

np.ndarray[path_length]: Nodes of the shortest path between the source and target.