# Assume that you are located at (A) which is New Orleans. Let Boston (B), Chicago (C) , Denver (D), and El Paso (E) represent four cities.Use the Brute Force Method to find the optimal solution to visiting each of the cities and returning home. Use the Nearest Neighbor Method to approximate the optimal solution. Identify how much money is being saved by using the optimal solution instead of the approximation.

Question
• Assume that you are located at (A) which is New Orleans. Let Boston (B), Chicago (C) , Denver (D), and El Paso (E) represent four cities.
• Use the Brute Force Method to find the optimal solution to visiting each of the cities and returning home.
• Use the Nearest Neighbor Method to approximate the optimal solution.
• Identify how much money is being saved by using the optimal solution instead of the approximation.
Step 1

Solution context

Since the data about the distances between the cities, modes of transport or transport costs are not given we will have to make some assumptions to go about solving the problem. Using google maps we find the following distances between the cities:

AB i.e. A to B : 1528 miles

AC : 925

AE : 1092

BC: 982

BD: 1972

BE: 2402

CD: 1004

CE: 1514

DE: 636

Since there are 5 cities and assuming they are all connected to each other so we get a fully connected graph with 10 edges. Assuming the cost of transport is proportional to the distance between the cities our problem is reduced to finding the Hamiltonian Circuit (HC) with the lowest total distance.

Step 2

Brute Force Method

Using the brute force method involves enumerating all the possible Hamiltonian circuits and finding the total distance travelled in each of them. Then we choose the circuit with the lowest value. Since it is a fully connected graph the total number of unique HCs is (n-1)! / 2 i.e. in this case 4!/2 or 12 unique HCs (a path’s exact reverse is not considered as it will entail same cost).  Brute force enumeration involves creating a tree and considering all the routes in the tree. Since full circuit we will have 5 edges the following levels indicate the nodes and following any route from level 0 downwards gives the full route (except for the ending city which is A).

Level  0:                                                                                A

Level 1:                                 B                                             C                                             D                                             E

Level 2:                 C       D         E                        B       D      E                           B       C        E                         B      C      D

Level 3:            D E      C  E     C   D     … … …

Level 4:             E D     E  C   … … … … … …

So we see that at level 1 there are 4 nodes, at level 2 there are 12 nodes, at level 3 there are 24 nodes and at level 4 again 24 nodes. So if we complete the tree we will have a list of all the 24 HCs half of them would be reverse of the other half. Considering only the unique 12 routes we need to calculate the distances.

For example for the first route down the tree we have the following:

A->B->C->D->E->A the total cost is

cost(AB) + cost(BC) + cost(CD) + cost(DE) + cost(EA)

= 1528 + 982 + 1004 + 636 + 1092 = 5242

We need to painstakingly find the total distance (cost) for all the 12 HCs in this manner.

Step 3

Nearest Neighbour algorithm

In this algorithm we start with a randomly selected node and then proceed by finding the nearest node and making a connection to it (if that node has not already been selected and connected to). For example, let’s start with node A and then find that C is nearest to it (925 miles). Then from C we find the nearest node (excluding A) and we find B is nearest (982). From B we find D is nearest (it is 1972 excluding A, C). From D...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Our solutions are written by experts, many with advanced degrees, and available 24/7

See Solution
Tagged in