INITIALIZATION Mark all the vertices as not visited and not processed .
boolean [ ] visited = new boolean [ V ] ; boolean [ ] processed = new boolean [ V ] ; Arrays . fill ( visited , false ) ; Arrays . fill ( processed , false ) ; int mindeg = Integer . MAX_VALUE ; int startvertex = 0 ;