private void drawArrowhead(Graphics g, Edge e) {
        int x = e.getEnd().getX();
        int y = e.getEnd().getY();
        int startX = e.getStart().getX();
        int startY = e.getStart().getY();
        /**
         * Calculate delta between start and end x and y
         */
        double deltaX = x - startX;
        double deltaY = y - startY;
        /**
         * Calculate length of the edge
         */
        double edgeLength = Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
        double angle = Math.atan2(deltaY, deltaX) + Math.PI;

        /*
         * Angle between edge and arrow's sides in radians
         */
        double sharpness = 0.45;
        /**
         * first calculate unit vector
         */
        double arrowSize = Math.sqrt(Math.pow((deltaX / edgeLength), 2) + Math.pow((deltaY / edgeLength), 2));
        /**
         * Desired length of side of the arrowhead, in pixels
         */
        arrowSize *= 25;

        Polygon p = new Polygon();
        p.addPoint(x, y);
        p.addPoint((int) (x + arrowSize * Math.cos(angle - sharpness)),
                (int) (y + arrowSize * Math.sin(angle - sharpness)));
        p.addPoint((int) (x + arrowSize * Math.cos(angle + sharpness)),
                (int) (y + arrowSize * Math.sin(angle + sharpness)));
        g.fillPolygon(p);

    }