public GraphNode searchNode(GraphNode<T> pgraphNode) {//returns the specified node, if not is null.
        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 (GraphNode) graph_nodes.get(i);
            }

        }
        return null;
    }