private void drawVertex(Graphics g, Vertex v) {
        if (v.getColor() == VertexColor.BLACK) {
            g.setColor(Color.BLACK);
        } else if (v.getColor() == VertexColor.GRAY) {
            g.setColor(Color.YELLOW);
        } else if (v.getColor() == VertexColor.WHITE) {
            g.setColor(Color.red);
        }
        int distance = v.getDistance();

        String distanceString;
        if (distance >= Integer.MAX_VALUE - 100000) {
            distanceString = "∞";
        } else {
            distanceString = "" + distance;
        }
        g.fillOval(v.getX() - 10, v.getY() - 10, 20, 20);
        g.setColor(Color.BLACK);
        g.drawOval(v.getX() - 10, v.getY() - 10, 20, 20);
        g.setFont(new Font("Sans", 1, 16));
        g.drawString(distanceString, v.getX(), v.getY() - 20);
    }