A table defines a collection of streets in a section of a major city. Many of the streets are oneway. In addition, there are several tunnels and bridges that allow the driver to skip over or under...


A table defines a collection of streets in a section of a major city. Many of the streets are oneway. In addition, there are several tunnels and bridges that allow the driver to skip over or under cross streets. The streets are all numbered. Even numbers are oriented east-west, while odd ones are oriented north-south. Each row of the table has the form • street number being described • cross street • cross street • mode (one-way or bidirectional) As an example, one row might look like 13, 4, 6, 1, indicating that it is describing street number 13 in the block where it spans between streets 4 and 6, and is one-way in the direction from street 4 to street 6. (If the line had been 13, 6, 4, 1, then the street would have been oneway between streets 6 and 4.) Another row might look like 13, 6, 22, 2, indicating that street 13 is a two-way street and either a tunnel or a bridge in the section where it links streets 6 and 22 (with no entrances or exits from/to other cross streets between 6 and 22). Complete one (or more) of the following: 1. Find the number of paths that a taxi could use to get from one intersection to another in the city without passing through any intersection more than once. 2. Find the shortest path (fewest blocks traveled) that a taxi could use to get from one intersection to another without passing through any intersection more than once. Note: The only intersections that are associated with bridges or tunnels are those at the two ends. 3. Find the longest path (most blocks traveled) that a taxi could use to get from one intersection to another without passing through any intersection more than once. Note: The only intersections that are associated with bridges or tunnels are those at the two ends.

May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here