void addUnvistedToStack ( View viewed , List < View > open ) { for ( int i = 0 ; i < viewed . connections . size ( ) ; i ++ ) { View other = viewed . connections . get ( i ) . destination ( viewed ) ; if ( other . state == ViewState . UNPROCESSED ) { other . state = ViewState . PENDING ; open . add ( other ) ; if ( verbose != null ) verbose . println ( " adding to open " + viewed . index + "->" + other . index ) ; } } }
Looks to see which connections have yet to be visited and adds them to the open list