private void moveToRoot()

in src/main/java/org/apache/commons/graph/collections/FibonacciHeap.java [488:514]


    private void moveToRoot( FibonacciHeapNode<E> node )
    {
        // 8'  if min[H] = NIL
        if ( isEmpty() )
        {
            // then min[H] <- x
            minimumNode = node;
        }
        else
        {
            // 7 concatenate the root list containing x with root list H
            node.getLeft().setRight( node.getRight() );
            node.getRight().setLeft( node.getLeft() );
            
            node.setLeft( minimumNode );
            node.setRight( minimumNode.getRight() );
            minimumNode.setRight( node );
            node.getRight().setLeft( node );

            // 8''  if key[x] < key[min[H]]
            if ( compare( node, minimumNode ) < 0 )
            {
                // 9     then min[H] <- x
                minimumNode = node;
            }
        }
    }