private static int getCheapestPath(final Vertix[] verticies,
            final int startNode, final int endNode, final int money) {

        /** Set states array to unvisited. **/
        boolean[][] states = new boolean[NODES][money + 1];
        /** Set minimum distance travelled to MAX. **/
        int[][] min = new int[NODES][money + 1];
        for (int i = 0; i < NODES; i++) {
            for (int j = 0; j < money; j++) {
                min[i][j] = Integer.MAX_VALUE;
            }
        }

        // Set minimum value for start node.
        min[startNode][money] = 0;

        while (true) {
            int k = 0;
            int l = 0;
            int minValue = Integer.MAX_VALUE;
            for (int i = 0; i < NODES; i++) {
                for (int j = 0; j < money + 1; j++) {
                    if (!states[i][j] && min[i][j] < minValue) {
                        k = i;
                        l = j;
                        minValue =  min[i][j];
                    }
                }
            }
            if (minValue == Integer.MAX_VALUE) {
                System.out.println("No solution");
                return -1;
            }

            states[k][l] = true;

            for (Vertix vertix : Vertix.getVertices(verticies, k)) {
                System.out.println("Vertix [" + vertix.mNodeA + "]["
                        + vertix.mNodeB + "][" + vertix.mCost + "]");

                /**
                 * TODO: Don't understand the given solution, would opt for a
                 * Breath First Search with heuristic instead.
                 */
            }
            return 2;
        }
    }