private LinkedHashMap < HypergraphNode < Variable > , Integer > createInitialOrdering ( final Formula formula , final Map < Variable , HypergraphNode < Variable > > nodes ) { final LinkedHashMap < HypergraphNode < Variable > , Integer > initialOrdering = new LinkedHashMap <> ( ) ; final List < Variable > dfsOrder = this . dfsOrdering . getOrder ( formula ) ; for ( int i = 0 ; i < dfsOrder . size ( ) ; i ++ ) initialOrdering . put ( nodes . get ( dfsOrder . get ( i ) ) , i ) ; return initialOrdering ; }
Creates an initial ordering for the variables based on a DFS .