> for doing this I thought the dictionary was excellent but the key is a
> string while I want it
> to be the 2 points forming the edge ? How to do it ?
Good news: keys don't have to be strings. So this is perfectly valid code:
d={}
d[((1,2), (3,4))] = 'whatever'