private void relax(Vertex u, Vertex v, Edge uv) {
        if (u.getDistance() < Integer.MAX_VALUE) {
            if (v.getDistance() > u.getDistance() + uv.getWeight()) {
                v.setDistance(u.getDistance() + uv.getWeight());
                v.setPath(u);
                heap.updateDecreasedElement(v);
                v.setColor(VertexColor.GRAY);
            }
        }
    }