public Iterable<MyEdge> calculatePath(int from, int to) {
		car = CreateGUI.returnInstance().getRb_car().isSelected();
		fastestRoute = CreateGUI.returnInstance().getRb_fast().isSelected();
		avoidHighways = CreateGUI.returnInstance().getAvoidHighways().isSelected();
		avoidFerries = CreateGUI.returnInstance().getAvoidFerries().isSelected();
		
		for (int v = 0; v < G.getNodeArray().length; v++) { //Resets the arrays so previous searches results are removed
			distTo[v] = Double.POSITIVE_INFINITY;
			edgeTo[v] = null;
		}

		distTo[from] = 0.0;

		// inserts vertices in order of distance from s
		pq = new IndexMinPQ<Double>(G.getNodeArray().length);
		pq.insert(from, distTo[from]);
		while (!pq.isEmpty()) {
			int v = pq.delMin();
			for (MyEdge e : G.getNodeArray()[v].getFromEdges()) // runs through all the from edges and sees if they should be on the calculated path
				checkEdge(e); // checks that the edge is acceptable, for example if the "avoid highways" check box is checked and the edge is a highway, then it is not accepted.
			for (MyEdge e : G.getNodeArray()[v].getToEdges()) // runs through all the to edges and sees if they should be on the calculated path
				checkEdge(e);
		}
		return pathTo(to);
	}