public void draw(Graphics graphics) {
        DynamicArray<Edge> drawnEdges = new DynamicArray();
        DynamicArray<Edge> edges = graph.getEdges();
        for (int i = 0; i < edges.getSize(); i++) {
            if (!drawnEdges.contains(edges.get(i)) || !drawnEdges.contains(Edge.reverse(edges.get(i)))) {
                drawEdge(graphics, edges.get(i));
                drawnEdges.insert(edges.get(i));
            }
        }
        DynamicArray<Vertex> vertices = graph.getVertices();
        for (int i = 0; i < vertices.getSize(); i++) {
            drawVertex(graphics, vertices.get(i));
        }


    }