(get-city-weight 'Dijon 'Paris) (get-city-weight 'Nancy 'Paris) (get-city-weight 'Calais 'Paris) (get-city-weight 'Caen 'Paris) (get-city-weight 'Rennes 'Paris) (get-city-weight 'Limoges 'Paris) (get-city-weight 'Lyon 'Limoges) (get-city-weight 'Toulouse 'Limoges) (get-city-weight 'Bordeaux 'Limoges) (get-city-weight 'Nantes 'Limoges) (get-city-weight 'Paris 'Limoges) (get-city-weight 'Calais 'Nancy) (get-city-weight 'Strasbourg 'Nancy) (get-city-weight 'Dijon 'Nancy) (get-city-weight 'Paris 'Nancy) (get-city-weight 'Lyon 'Dijon) (get-city-weight 'Strasbourg 'Dijon) (get-city-weight 'Nancy 'Dijon) (get-city-weight 'Paris 'Dijon) (get-city-weight 'Dijon 'Strasbourg ) (get-city-weight 'Nancy 'Strasbourg) (get-city-weight 'Dijon 'Lyon) (get-city-weight 'Limoges 'Lyon) (get-city-weight 'Avignon 'Lyon) (get-city-weight 'Grenoble 'Lyon) (get-city-weight 'Avignon 'Grenoble) (get-city-weight 'Lyon 'Grenoble) (get-city-weight 'Marseille 'Avignon) (get-city-weight 'Montpellier 'Avignon) (get-city-weight 'Lyon 'Avignon) (get-city-weight 'Grenoble 'Avignon) (get-city-weight 'Avignon 'Marseille) (get-city-weight 'Nice 'Marseille) (get-city-weight 'Marseille 'Nice) (get-city-weight 'Avignon 'Montpellier) (get-city-weight 'Toulouse 'Montpellier) (get-city-weight 'Montpellier 'Toulouse) (get-city-weight 'Limoges 'Toulouse) (get-city-weight 'Bordeaux 'Toulouse) (get-city-weight 'Nantes 'Bordeaux) (get-city-weight 'Limoges 'Bordeaux) (get-city-weight 'Toulouse 'Bordeaux) (get-city-weight 'Bordeaux 'Nantes) (get-city-weight 'Limoges 'Nantes) (get-city-weight 'Rennes 'Nantes) (get-city-weight 'Paris 'Rennes) (get-city-weight 'Nantes 'Rennes) (get-city-weight 'Brest 'Rennes) (get-city-weight 'Caen 'Rennes) (get-city-weight 'Rennes 'Brest) (get-city-weight 'Paris 'Caen) (get-city-weight 'Calais 'Caen) (get-city-weight 'Rennes 'Caen) (get-city-weight 'Paris 'Calais) (get-city-weight 'Caen 'Calais) (get-city-weight 'Nancy 'Calais) (convert-to-secs 1 1 1) (convert-to-secs 'a 'b 'c) (convert-to-secs 1 'b 'c) (convert-to-secs 1 1 'c) (sqr 1) (sqr 2) (sqr 'a) (sqr ()) (distance 1 1 1 1) (distance 1 1 2 1) (distance -1 -1 -2 -1) (distance 1 -1 2 -1) (distance -1 1 -2 1) (distance 'a 'b 'c 'd) (distance 1 'b 'c 'd) (distance 1 1 'c 'd) (distance 1 1 1 'd) (setq coordinates (get 'Paris 'coordinates)) (get-x-coor coordinates) (get-y-coor coordinates) (get-city-distance 'Paris 'Caen) (get-city-distance 'Paris 'Calais) (get-city-distance 'Paris 'Dijon) (get-city-distance 'Paris 'Lyon) (get-city-distance 'Paris 'Grenoble) (get-city-distance 'Paris 'Avignon) (get-city-distance 'Paris 'Marseille) (get-city-distance 'Paris 'Nice) (get-city-distance 'Paris 'Montpellier) (get-city-distance 'Paris 'Toulouse) (get-city-distance 'Paris 'Bordeaux) (get-city-distance 'Paris 'Limoges) (get-city-distance 'Paris 'Rennes) (get-city-distance 'Paris 'Brest) (get-city-distance 'Paris 'Strasbourg) (get-city-distance 'Paris 'Nancy) (get-city-distance 'Paris 'Nantes) (bfs 'Paris (get 'Caen 'neighbors) 1 1 1 '(Caen)) (bfs 'Paris (get 'Calais 'neighbors) 1 1 1 '(Calais)) (bfs 'Paris (get 'Dijon 'neighbors) 1 1 1 '(Dijon)) (bfs 'Paris (get 'Lyon 'neighbors) 1 1 1 '(Lyon)) (bfs 'Paris (get 'Grenoble 'neighbors) 1 1 1 '(Grenoble)) (bfs 'Paris (get 'Avignon 'neighbors) 1 1 1 '(Avignon)) (bfs 'Paris (get 'Marseille 'neighbors) 1 1 1 '(Marseille)) (bfs 'Paris (get 'Nice 'neighbors) 1 1 1 '(Nice)) (bfs 'Paris (get 'Montpellier 'neighbors) 1 1 1 '(Montpellier)) (bfs 'Paris (get 'Toulouse 'neighbors) 1 1 1 '(Toulouse)) (bfs 'Paris (get 'Bordeaux 'neighbors) 1 1 1 '(Bordeaux)) (bfs 'Paris (get 'Limoges 'neighbors) 1 1 1 '(Limoges)) (bfs 'Paris (get 'Rennes 'neighbors) 1 1 1 '(Rennes)) (bfs 'Paris (get 'Brest 'neighbors) 1 1 1 '(Brest)) (bfs 'Paris (get 'Strasbourg 'neighbors) 1 1 1 '(Strasbourg)) (bfs 'Paris (get 'Nancy 'neighbors) 1 1 1 '(Nancy)) (bfs 'Paris (get 'Nantes 'neighbors) 1 1 1 '(Nantes)) (eval-min (get 'Paris 'neighbors) 9999 'min-node) (eval-min (get 'Caen 'neighbors) 9999 'min-node) (eval-min (get 'Calais 'neighbors) 9999 'min-node) (eval-min (get 'Dijon 'neighbors) 9999 'min-node) (eval-min (get 'Lyon 'neighbors) 9999 'min-node) (eval-min (get 'Grenoble 'neighbors) 9999 'min-node) (eval-min (get 'Avignon 'neighbors) 9999 'min-node) (eval-min (get 'Marseille 'neighbors) 9999 'min-node) (eval-min (get 'Nice 'neighbors) 9999 'min-node) (eval-min (get 'Montpellier 'neighbors) 9999 'min-node) (eval-min (get 'Toulouse 'neighbors) 9999 'min-node) (eval-min (get 'Bordeaux 'neighbors) 9999 'min-node) (eval-min (get 'Limoges 'neighbors) 9999 'min-node) (eval-min (get 'Rennes 'neighbors) 9999 'min-node) (eval-min (get 'Brest 'neighbors) 9999 'min-node) (eval-min (get 'Strasbourg 'neighbors) 9999 'min-node) (eval-min (get 'Nancy 'neighbors) 9999 'min-node) (eval-min (get 'Nantes 'neighbors) 9999 'min-node) (hcs 'Calais (eval-min (get 'Paris 'neighbors) 9999 'min-node) 1 1 1 '(Paris)) (hcs 'Marseille (eval-min (get 'Toulouse 'neighbors) 9999 'min-node) 1 1 1 '(Toulouse)) (hcs 'Grenoble (eval-min (get 'Dijon 'neighbors) 9999 'min-node) 1 1 1 '(Dijon)) (hcs 'Paris (eval-min (get 'Caen 'neighbors) 9999 'min-node) 1 1 1 '(Caen)) (hcs 'Paris (eval-min (get 'Calais 'neighbors) 9999 'min-node) 1 1 1 '(Calais)) (hcs 'Paris (eval-min (get 'Dijon 'neighbors) 9999 'min-node) 1 1 1 '(Dijon)) (hcs 'Paris (eval-min (get 'Lyon 'neighbors) 9999 'min-node) 1 1 1 '(Lyon)) (hcs 'Paris (eval-min (get 'Grenoble 'neighbors) 9999 'min-node) 1 1 1 '(Grenoble)) (hcs 'Paris (eval-min (get 'Avignon 'neighbors) 9999 'min-node) 1 1 1 '(Avignon)) (hcs 'Paris (eval-min (get 'Marseille 'neighbors) 9999 'min-node) 1 1 1 '(Marseille)) (hcs 'Paris (eval-min (get 'Nice 'neighbors) 9999 'min-node) 1 1 1 '(Nice)) (hcs 'Paris (eval-min (get 'Montpellier 'neighbors) 9999 'min-node) 1 1 1 '(Montpellier)) (hcs 'Paris (eval-min (get 'Toulouse 'neighbors) 9999 'min-node) 1 1 1 '(Toulouse)) (hcs 'Paris (eval-min (get 'Bordeaux 'neighbors) 9999 'min-node) 1 1 1 '(Bordeaux)) (hcs 'Paris (eval-min (get 'Limoges 'neighbors) 9999 'min-node) 1 1 1 '(Limoges)) (hcs 'Paris (eval-min (get 'Rennes 'neighbors) 9999 'min-node) 1 1 1 '(Rennes)) (hcs 'Paris (eval-min (get 'Brest 'neighbors) 9999 'min-node) 1 1 1 '(Brest)) (hcs 'Paris (eval-min (get 'Strasbourg 'neighbors) 9999 'min-node) 1 1 1 '(Strasbourg)) (hcs 'Paris (eval-min (get 'Nancy 'neighbors) 9999 'min-node) 1 1 1 '(Nancy)) (hcs 'Paris (eval-min (get 'Nantes 'neighbors) 9999 'min-node) 1 1 1 '(Nantes)) (eval-cost (get 'Paris 'neighbors) 0) (insert-node-in-order 'a 1 '(b 2 c 3 d 4)) (insert-node-in-order 'b 2 '(a 1 c 3 d 4)) (insert-node-in-order 'c 3 '(a 1 b 2 d 4)) (insert-node-in-order 'd 4 '(a 1 b 2 c 3)) (insert-node-in-order nil nil '(a 1 b 2 c 3 d 4)) (insert-node-in-order 'a '1 '()) (sort-nodes '(a 1 b 2) '()) (sort-nodes '(b 2 a 1) '()) (sort-nodes '(a 1 b 2) '(d 4)) (sort-nodes '(a 1 b 2) '(c 3 d 4)) (sort-nodes '(b 2 c 3) '(a 1 d 4)) (sort-nodes '(c 3 d 4) '(a 1 b 2)) (sort-nodes '(a 1 d 4) '(b 2 c 3)) (sort-nodes '(b 2 d 4) '(a 1 c 3)) (sort-set '((NICE 188 MARSEILLE 99 AVIGNON 121 MONTPELLIER 0) 408 (NICE 188 MARSEILLE 99 AVIGNON 121 MONTPELLIER 0) 408 (GRENOBLE 104 LYON 216 AVIGNON 121 MONTPELLIER 0) 441 (BORDEAUX 253 TOULOUSE 240 MONTPELLIER 0) 493 (NICE 188 MARSEILLE 99 AVIGNON 121 MONTPELLIER 0) 408 (BORDEAUX 253 TOULOUSE 240 MONTPELLIER 0) 493 (DIJON 192 LYON 216 AVIGNON 121 MONTPELLIER 0) 529 (LIMOGES 313 TOULOUSE 240 MONTPELLIER 0) 553 (LIMOGES 313 LYON 216 AVIGNON 121 MONTPELLIER 0) 650)) (sort-set '((PARIS 313 DIJON 192 LYON 104 GRENOBLE 0) 609 (DIJON 192 LYON 216 AVIGNON 227 GRENOBLE 0) 635 (PARIS 313 LIMOGES 389 LYON 104 GRENOBLE 0) 806 (BORDEAUX 253 TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0) 841 (NICE 188 MARSEILLE 99 AVIGNON 227 GRENOBLE 0) 514 (NICE 188 MARSEILLE 99 AVIGNON 216 LYON 104 GRENOBLE 0) 607 (DIJON 192 LYON 216 AVIGNON 227 GRENOBLE 0) 635 (LIMOGES 313 TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0) 901 (LIMOGES 313 PARIS 313 DIJON 192 LYON 104 GRENOBLE 0) 922 (BORDEAUX 253 TOULOUSE 240 MONTPELLIER 121 AVIGNON 216 LYON 104 GRENOBLE 0) 934 (LIMOGES 313 TOULOUSE 240 MONTPELLIER 121 AVIGNON 216 LYON 104 GRENOBLE 0) 994 (DIJON 192 PARIS 313 LIMOGES 389 LYON 104 GRENOBLE 0) 998 (BORDEAUX 253 LIMOGES 389 LYON 216 AVIGNON 227 GRENOBLE 0) 1085 (BORDEAUX 253 LIMOGES 389 TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 1230 (BORDEAUX 253 LIMOGES 389 PARIS 313 DIJON 192 LYON 104 GRENOBLE 0) 1251)) (setq a-set (create-set '(city 9)(get 'Paris 'neighbors))) (update-sets '(Limoges 2) 'Toulouse '((LYON 216 AVIGNON 227 GRENOBLE 0) 441 (TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 588)) (update-sets '(Avignon 2) 'Lyon '((LYON 216 AVIGNON 227 GRENOBLE 0) 441 (TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 588)) (update-sets '(Paris 2) 'Limoges '((LIMOGES 2 LYON 216 AVIGNON 227 GRENOBLE 0) 445 (LIMOGES 2 TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0) 590)) (add-sets '(Avignon 2 Dijon 2) 'Lyon '((LYON 216 AVIGNON 227 GRENOBLE 0) 441 (TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 588)) (setq a-set (add-sets '(Avignon 2 Dijon 2 Limoges 2 Paris 2 Lyon 2 Bordeaux 2) 'Lyon '((LYON 216 AVIGNON 227 GRENOBLE 0) 441 (TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 588))) (setq a-set (add-sets '(Avignon 2 Dijon 2 Limoges 2 Paris 2 Lyon 2 Bordeaux 2) 'Toulouse '((LYON 216 AVIGNON 227 GRENOBLE 0) 441 (TOULOUSE 240 MONTPELLIER 121 AVIGNON 227 GRENOBLE 0 ) 588))) (trim-sets ' Toulouse (sort-set a-set)) (trim-sets ' Lyon (sort-set a-set)) (get-node 'Paris (get 'Caen 'neighbors)) (setq current-path '(Paris 1)) (setq next-node (eval-min (get 'Paris 'neighbors) 9999 'min-node)) (setq next-path (append next-node current-path)) (setq next-path-cost (eval-cost next-path 0)) (setq next-path-set (list next-path next-path-cost)) (setq alt-node (list (first (get 'Paris 'neighbors)) (second (get 'Paris 'neighbors)))) (setq alt-path (append alt-node current-path)) (setq alt-path-cost (eval-cost alt-path 0)) (setq alt-path-set (list alt-path alt-path-cost)) (setq old-search-set (append alt-path-set next-path-set)) (setq new-search-set (update-sets '(next-node 3) 'Limoges old-search-set)) (cdr (cdr (sort-nodes new-search-set '(null-set -99999)))) (sort-set new-search-set) (eval-min-set new-search-set) (get-metric 'Paris 'Caen) (get-metric 'Paris 'Toulouse) (list 'Caen (get-metric 'Paris 'Caen)) (bnb 'Paris (list 'Caen 0) 1 1 1 (list 'Caen 0) (create-set (list 'Caen 0)())) (bnb 'Paris (list 'Calais 0) 1 1 1 (list 'Calais 0) (create-set (list 'Calais 0)())) (bnb 'Paris (list 'Dijon 0) 1 1 1 (list 'Dijon 0) (create-set (list 'Dijon 0)())) (bnb 'Paris (list 'Lyon 0) 1 1 1 (list 'Lyon 0) (create-set (list 'Lyon 0)())) (bnb 'Paris (list 'Grenoble 0) 1 1 1 (list 'Grenoble 0) (create-set (list 'Grenoble 0)())) (bnb 'Paris (list 'Avignon 0) 1 1 1 (list 'Avignon 0) (create-set (list 'Avignon 0)())) (bnb 'Paris (list 'Marseille 0) 1 1 1 (list 'Marseille 0) (create-set (list 'Marseille 0)())) (bnb 'Paris (list 'Nice 0) 1 1 1 (list 'Nice 0) (create-set (list 'Nice 0)())) (bnb 'Paris (list 'Montpellier 0) 1 1 1 (list 'Montpellier 0) (create-set (list 'Montpellier 0)())) (bnb 'Paris (list 'Toulouse 0) 1 1 1 (list 'Toulouse 0) (create-set (list 'Toulouse 0)())) (bnb 'Paris (list 'Bordeaux 0) 1 1 1 (list 'Bordeaux 0) (create-set (list 'Bordeaux 0)())) (bnb 'Paris (list 'Limoges 0) 1 1 1 (list 'Limoges 0) (create-set (list 'Limoges 0)())) (bnb 'Paris (list 'Rennes 0) 1 1 1 (list 'Rennes 0) (create-set (list 'Rennes 0)())) (bnb 'Paris (list 'Brest 0) 1 1 1 (list 'Brest 0) (create-set (list 'Brest 0)())) (bnb 'Paris (list 'Strasbourg 0) 1 1 1 (list 'Strasbourg 0) (create-set (list 'Strasbourg 0)())) (bnb 'Paris (list 'Nancy 0) 1 1 1 (list 'Nancy 0) (create-set (list 'Nancy 0)())) (bnb 'Paris (list 'Nantes 0) 1 1 1 (list 'Nantes 0) (create-set (list 'Nantes 0)())) ;;; goal initial initial (bfs 'Marseille (get 'Brest 'neighbors) 1 1 1 '(Brest)) (bfs 'Calais (get 'Montpellier 'neighbors) 1 1 1 '(Montpellier)) (bfs 'Bordeaux (get 'Strasbourg 'neighbors) 1 1 1 '(Strasbourg)) (bfs 'Grenoble (get 'Paris 'neighbors) 1 1 1 '(Paris)) (bfs 'Paris (get 'Grenoble 'neighbors) 1 1 1 '(Grenoble)) (bfs 'Grenoble (get 'Brest 'neighbors) 1 1 1 '(Brest)) (bfs 'Brest (get 'Grenoble 'neighbors) 1 1 1 '(Grenoble)) ;;; goal initial initial (hcs 'Marseille (eval-min (get 'Brest 'neighbors) 9999 'min-node) 1 1 1 '(Brest)) (hcs 'Calais (eval-min (get 'Montpellier 'neighbors) 9999 'min-node) 1 1 1 '(Montpellier)) (hcs 'Bordeaux (eval-min (get 'Strasbourg 'neighbors) 9999 'min-node) 1 1 1 '(Strasbourg)) (hcs 'Grenoble (eval-min (get 'Paris 'neighbors) 9999 'min-node) 1 1 1 '(Paris)) (hcs 'Paris (eval-min (get 'Grenoble 'neighbors) 9999 'min-node) 1 1 1 '(Grenoble)) (hcs 'Grenoble (eval-min (get 'Brest 'neighbors) 9999 'min-node) 1 1 1 '(Brest)) (hcs 'Brest (eval-min (get 'Grenoble 'neighbors) 9999 'min-node) 1 1 1 '(Grenoble)) ;;; goal initial initial initial (bnb 'Marseille (list 'Brest 0) 1 1 1 (list 'Brest 0) (create-set (list 'Brest 0)())) (bnb 'Calais (list 'Montpellier 0) 1 1 1 (list 'Montpellier 0) (create-set (list 'Montpellier 0)())) (bnb 'Bordeaux (list 'Strasbourg 0) 1 1 1 (list 'Strasbourg 0) (create-set (list 'Strasbourg 0)())) (bnb 'Grenoble (list 'Paris 0) 1 1 1 (list 'Paris 0) (create-set (list 'Paris 0)())) (bnb 'Paris (list 'Grenoble 0) 1 1 1 (list 'Grenoble 0) (create-set (list 'Grenoble 0)())) (bnb 'Grenoble (list 'Brest 0) 1 1 1 (list 'Brest 0) (create-set (list 'Brest 0)())) (bnb 'Brest (list 'Grenoble 0) 1 1 1 (list 'Grenoble 0) (create-set (list 'Grenoble 0)()))