wting / python-graph

Automatically exported from code.google.com/p/python-graph
Other
5 stars 3 forks source link

Enhancement needed to be able to change edge/arrow weight #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use generate() to create a new graph. All edges will be initialized with
 default weight 1.0
2. Try to create a more "interesting" graph from the above by assigning
random weight to existing links.
3. To do so you need to know the internal representation of the graph,
which defeats the purpose of the nice graph class

What is the expected output? What do you see instead?

- expected to see a set_weight((n1, n2), weight) method (or similar).

What version of the product are you using? On what operating system?

- 1.0/1.1(HEAD), Linux

Please provide any additional information below.

Would be nice to have a more extended generate() with optional weight
envelope as argument. Use of a uniformly distributed random number would be
adequate. The signature may be. (I can write this tomorrow, if you want,
and submit it.)

Original issue reported on code.google.com by zs.haras...@gmail.com on 29 Aug 2008 at 4:17

GoogleCodeExporter commented 9 years ago
Issue accepted. A patch would be very nice indeed as I'm a bit overworked now.

Don't forget to tell me your full name so I can give you the credits for this. 
Cheers.

Original comment by pmatiello on 29 Aug 2008 at 4:31

GoogleCodeExporter commented 9 years ago
Here is the patch, implementing both. Please let me know if you see any issues 
with
it. I tested all the edge related features, but I have not tested it for arrows.

My name and email is:

Zsolt Haraszti
zsolt at drawwell dot net

Cheers

Original comment by zs.haras...@gmail.com on 29 Aug 2008 at 11:14

Attachments:

GoogleCodeExporter commented 9 years ago
Your patch has been applied and commited. Check in svn (r152). Thanks. :)

Original comment by pmatiello on 30 Aug 2008 at 1:32