public void printNodeLinks(GraphNode  node){//prints all links from a node ignoring if the a node doesnt have links and its list is null.
        for(int i=0;i<node.getLinks().getLength();i++) {
            if (node.getLinks().get(i) == null) {//if the node does not have links.
                continue;
            }
            else {
                System.out.println(((GraphNode) node.getLinks().get(i)).getNombre_elemento());
            }
        }
    }