public int searchNodePosition(GraphNode<T> pgraphNode) {//return the actual position of the node in the parameter
        for (int i = 0; i < graph_nodes.getLength(); i++) {
            if (pgraphNode.equals(graph_nodes.get(i))) {//if param is equal to node in list.
                return i;
            }

        }
        return -1;//node is not in the list.
    }