function findRoute(source, dest) {
        startArr = priority[source];
        finArr = priority[dest];

        //  Those airports who have a priority for operation at source
        for (var key of Object.keys(startArr)) {
            if (startArr[key] >= typeS) {
                tempnode1.push(key)

            }
        }
        //Those airports who have a priority for operation at destination
        for (var key of Object.keys(finArr)) {

            if (finArr[key] >= typeD) {
                tempnode2.push(key)

            }
        }
        /* The two above loops find out the (n-1) deep airports in the connection */

        //If there exists a direct flight b/w Destination and Source 

        if (startArr[dest] !== -1) {
            node.push(null); //FLAG
            //node = tempnode1.filter(value => tempnode2.includes(value));


        } else {
            //If there exists jumping flights

            //assign common airports here: Find common airports in tempnode1[] and tempnode2[]
            node = tempnode1.filter(value => tempnode2.includes(value));

            if (node.length == 0) { //If there are no common aiports found
                node.push(0); //FLAG
                // Connect one of the values in startarr[] to finArr[] using an existing intermediate value, ie. an International (type 2) flight 
                for (k = 0; k < tempnode1.length; k++) {
                    for (l = 0; l < tempnode2.length; l++) {
                        if (getNode(tempnode1[k], tempnode2[l]) !== -1) {
                            node.push(tempnode1[k], tempnode2[l])
                        }
                    }
                }
            }

        }

        return nodes;
    }
//  Function to find common airports and generate a route

Function to find common airports and generate a route
Function to find common airports and generate a route
function findRoute(source, dest) {
        startArr = priority[source];
        finArr = priority[dest];
        for (var key of Object.keys(startArr)) {
            if (startArr[key] >= typeS) {
                tempnode1.push(key)
            }
        }
        for (var key of Object.keys(finArr)) {
            if (finArr[key] >= typeD) {
                tempnode2.push(key)
            }
        }
        if (startArr[dest] !== -1) {
            node.push(null); 
        } else {
            node = tempnode1.filter(value => tempnode2.includes(value));
            if (node.length == 0) { 
                node.push(0); 
                for (k = 0; k < tempnode1.length; k++) {
                    for (l = 0; l < tempnode2.length; l++) {
                        if (getNode(tempnode1[k], tempnode2[l]) !== -1) {
                            node.push(tempnode1[k], tempnode2[l])
                        }
                    }
                }
            }
        }
        return nodes;
    }
function findRoute ( source , dest ) { startArr = priority [ source ] ; finArr = priority [ dest ] ; for ( var key of Object . keys ( startArr ) ) { if ( startArr [ key ] >= typeS ) { tempnode1 . push ( key ) } } for ( var key of Object . keys ( finArr ) ) { if ( finArr [ key ] >= typeD ) { tempnode2 . push ( key ) } } if ( startArr [ dest ] !== - 1 ) { node . push ( null ) ; } else { node = tempnode1 . filter ( value => tempnode2 . includes ( value ) ) ; if ( node . length == 0 ) { node . push ( 0 ) ; for ( k = 0 ; k < tempnode1 . length ; k ++ ) { for ( l = 0 ; l < tempnode2 . length ; l ++ ) { if ( getNode ( tempnode1 [ k ] , tempnode2 [ l ] ) !== - 1 ) { node . push ( tempnode1 [ k ] , tempnode2 [ l ] ) } } } } } return nodes ; }
Function to find common airports and generate a route
Function to find common airports and generate a route
//  Those airports who have a priority for operation at source
 //Those airports who have a priority for operation at destination
 /* The two above loops find out the (n-1) deep airports in the connection */ //If there exists a direct flight b/w Destination and Source 
 //FLAG
 //node = tempnode1.filter(value => tempnode2.includes(value));
 //If there exists jumping flights
 //assign common airports here: Find common airports in tempnode1[] and tempnode2[]
 //If there are no common aiports found
 //FLAG
 // Connect one of the values in startarr[] to finArr[] using an existing intermediate value, ie. an International (type 2) flight 
