jody@computer.org |
|
Problem: Given a graph representing locations and travel among those locations, determine routes according to specified criteria. The nodes of a graph are considered locations. Each location has a cost associated with visitng that location. The edges of a graph are considered direct travel connections between two locations. Each edge has a cost and a time associated with traversing that edge. Edges are non-directional. The product must address finding the following routes:
Sample Graph |
|
Sample Graph Input Format |
|
Location: |
(name cost) |
Graph: |
(Loc/Con1
Loc/Con2 ... Loc/ConN) |
Sample Graph: |
(define G '((C 10) |
Route: | ((loc1 loc2 ... locN) cost time) |
Function Invocation Syntax | |
Functions: | (cheapest Graph SourceLoc DestLoc) (shortest-time Graph SourceLoc DestLoc) (least-legs Graph SourceLoc DestLoc) (layover Graph SourceLoc IntLoc DestLoc) (tour Graph Loc) (cheapest-tour Graph Loc) (h-tour Graph) (ts-tour Graph Loc) (e-tour Graph) |
Sample Function Invocations and Return Values | |
(cheapest G 'A
'D) ((A C D) 167 75) (shortest-time G 'A 'D) ((A E D) 220 70) |