public PrepareContractionHierarchies useFixedNodeOrdering ( NodeOrderingProvider nodeOrderingProvider ) { if ( nodeOrderingProvider . getNumNodes ( ) != prepareGraph . getNodes ( ) ) { throw new IllegalArgumentException ( "contraction order size (" + nodeOrderingProvider . getNumNodes ( ) + ")" + " must be equal to number of nodes in graph (" + prepareGraph . getNodes ( ) + ")." ) ; } this . nodeOrderingProvider = nodeOrderingProvider ; return this ; }
Instead of heuristically determining a node ordering for the graph contraction it is also possible to use a fixed ordering . For example this allows re - using a previously calculated node ordering . This will speed up CH preparation but might lead to slower queries .