public void computeShortestPaths(DialARideModel model) {
		List<Node> nodes = model.getNodes();
		int numOfNodes = nodes.size();
		int[][] cost = model.getCost();
		int[][] prev = model.getPrev();
		for (int sourceNode = 0; sourceNode < numOfNodes; sourceNode += 1) {
			boolean[] visited = new boolean[numOfNodes];
			for (int index = 0; index < numOfNodes; index += 1) {
				cost[sourceNode][index] = Integer.MAX_VALUE;
				if (sourceNode == index) {
					cost[sourceNode][index] = 0;
					prev[sourceNode][index] = 0;
				}
				visited[index] = false;
			}
			CostComparator costComparator = new CostComparator();
			Queue<Cost> costQueue = new PriorityQueue<Cost>(numOfNodes,
					costComparator);
			costQueue.add(new Cost(sourceNode, 0));
			while (!costQueue.isEmpty()) {
				Cost costVal = costQueue.remove();
				int src = costVal.getNodeNumber();
				if (!visited[src]) {
					visited[src] = true;
					Node node = nodes.get(src);
					for (Neighbour neighbour : node.getNeighbours().values()) {
						int dest = neighbour.getNodeNumber();
						if (!visited[dest]) {
							if (cost[sourceNode][dest] > cost[sourceNode][src]
									+ neighbour.getDistance()) {
								cost[sourceNode][dest] = cost[sourceNode][src]
										+ neighbour.getDistance();
								prev[sourceNode][dest] = src;
								costQueue.add(new Cost(dest,
										cost[sourceNode][dest]));
							}
						}
					}
				}
			}
		}
	}