TSP of 5 Cities

Just doing my homework, this is the result:


The code inside is stupid…but since I code it only in 4 hrs, it should be fine for now, at least it works. Will continue to optimize the code if I have time.


One More Interesting Problem (Still from Basic Graph Theory)

  1. Suppose that you and your spouse/partner attended a party with three other couples. Several handshakes took place. None shook hands with him/herself or with his/her spouse/partner, and no one shook hands with the same person more than once. Sup- pose you ask each person, including your own date, how many hands he/she shook and found that each person gave a different answer.

    (a) How many hands did you shake?
    (b) How many hands did your date shake? 

    Solutions will be posted next week also 😉

Interesting Problem in Graph Theory

One of my homework problem for SYSM6302: Dynamics of Complex Networks and Systems, where we review basics of Graph Theory:

Here is a diagram of a prison for political dissidents. The prisoners have been divided into seven groups as shown. A spy plans to help all the prisoners escape by blowing up the gates in the prison walls. Due to the danger of this plan, he wants to destroy as few gates as possible and still allow all prisoners to escape. How many gates must be blasted to do this?


The answer will be posted next week 😉