question: public int [ ] breadthFirstSearch ( int intialValue , IBFSTraversable < N > traversable , int firstValue , IIntegerBfsNextValueIterator < N > nextValueIterator , List < Integer > sourcesIndex ) { int [ ] results = new int [ nodes . length ] ; Arrays . fill ( results , intialValue ) ; boolean [ ] alreadyScanned = new boolean [ nodes . length ] ; Arrays . fill ( alreadyScanned , false ) ; Set < Integer > currentNodesIndex = new HashSet < > ( sourcesIndex ) ; iterativeIntegerBreadthFirstSearch ( results , alreadyScanned , currentNodesIndex , firstValue , 0 , traversable , nextValueIterator ) ; return results ; }
target:  Breadth-first search implementation for integers.  See double implementation for the parameters details. Note that for compilation reasons parameters are in a different order compared to the double version Hint: you can compute distances by providing to the sources by providing a +1 next value visitor