t=Graph({1:[2,5,7],2:[1,3,8],3:[2,4,9],4:[3,5,10],5:[1,4,6],6:[11,12],7:[12,13],8:[13,14],9:[14,15],10:[11,15],11:[6,10,20],12:[6,7,19],13:[7,8,18],14:[8,9,17],15:[9,10,16],16:[15,17,20],17:[14,16,18],18:[13,17,19],19;[12,17,20],20:[11,16,19]})

t.plot() p=hamiltonian_cycle() p.plot() //gives the hamiltonian cycle

Kreyszig-21.2-10-U (last edited 2010-12-18 10:14:50 by Aditya J)