public final void performAStarTime(int start, int stop, JPFMap map){
        //initialize
        if (map==null) return;
        Node node = new Node(null, start, map, stop);
        PriorityQueue<Node> open = new PriorityQueue<Node>();
        
        //search & visualisation phase
        while(node.val != stop){
            
            int[]neighbours=map.getCityNeighbours(node.val); //get ids of neighbouring cities
            for (int i : neighbours) {
                Node n = new Node(node, i, map, stop);
                open.add(n);
            }
            
            Node new_node=open.poll(); //go to next neighbour
            
            node = new_node; //switch parent to new node and repeat
        }
        
        Stack<Node> path = new Stack<Node>();
        path.push(node);
        while(node.parent != null){
            node = node.parent;
            path.push(node);
        }

        finder.inform("Path Discovered!");
        if(path.size() == 1){
            Node n = path.pop();
            map.drawPath(n.val,n.val,Color.PINK);
        }
        
        Node act = path.pop();
        Node next = path.pop();
        
        while(!path.empty()){
            map.drawPath(act.val, next.val); //draw a line from the parent to the selected node (visualisation purposes)
            map.highlightCities(new int[]{next.val}, Color.cyan);  //highlight the selected node (visualisation purposes)
            finder.inform("Going to " + next.val);
            act = next;
            next = path.pop();
            try {
                Thread.sleep(100); //wait or a while so that the search can be seen in the visualisation (visualisation purposes)
            } catch (InterruptedException ex) {/**/}
        }
        
        map.drawPath(act.val, next.val); //draw a line from the parent to the selected node (visualisation purposes)
        map.highlightCities(new int[]{next.val}, Color.cyan);  //highlight the selected node (visualisation purposes)
        finder.inform("Going to " + next.val);
    }