public Map<GraphObject, Integer> run()
	{
		initMaps();

		// Add all source nodes to the queue if traversal is needed

		if (limit > 0)
		{
			queue.addAll(sourceSet);
		}

		// Initialize dist and color of source set

		for (Node source : sourceSet)
		{
			setLabel(source, 0);
			setColor(source, GRAY);

			labelEquivRecursive(source, UPWARD, 0, true, false);
			labelEquivRecursive(source, DOWNWARD, 0, true, false);
		}

		// Process the queue

		while (!queue.isEmpty())
		{
			Node current = queue.remove(0);

			processNode(current);

			// Current node is processed
			setColor(current, BLACK);
		}

		return dist;
	}
public Map < GraphObject , Integer > run ( ) { initMaps ( ) ; if ( limit > 0 ) { queue . addAll ( sourceSet ) ; } for ( Node source : sourceSet ) { setLabel ( source , 0 ) ; setColor ( source , GRAY ) ; labelEquivRecursive ( source , UPWARD , 0 , true , false ) ; labelEquivRecursive ( source , DOWNWARD , 0 , true , false ) ; } while ( ! queue . isEmpty ( ) ) { Node current = queue . remove ( 0 ) ; processNode ( current ) ; setColor ( current , BLACK ) ; } return dist ; }
Executes the algorithm.
@return BFS tree