Computer Programming and Discrete Mathematics: A Learning Community


Patrick Bibby - Mathematics - Miami Dade College

 

Nannette Bibby - Computer Science - Miami Dade College

 


 

IPO Chart

 

Input

Processing

Output

Number of cities

Names of connections

Distances between cities

 

Processing Items:

Number of connections

 

Algorithm:

1.  enter the number of cities

2.  calculate the number of connections

3.  enter the names of pairs of cities

4.  enter the distances between cities

5.  sort connections by distances in descending order

6.  calculate the minimal connection.

7.  calculate total mileage in the minimal connection

Connections sorted in descending order of distance

 

Minimal network connection

 

Total mileage