|
Posted by Toby A Inkster on 01/20/08 10:29
The Natural Philosopher wrote:
> I can't think of a single application for such a program.
Weighted graphs are a useful tool in many diverse areas of endeavour such
as network routing, road traffic planning, social networks and
international diplomacy.
Unless the OP is wedded to PHP, I think he should check out Perl's
Graph::Easy module, which is a very good module for building an
traversing graphs. It supports directed graphs, but doesn't specifically
support weighted graphs -- however, edges can be labelled, so you could
use numeric labels on the edges to identify weights. They can also be
styled, so you could use colour or thickness. It allows export as SVG --
it should be fairly easy to convert from SVG to JPEG, PNG or whatever
other format you want.
As an aside, you mention using line lengths to visually represent the
weight. Consider nodes A, B and C with edges (A,B,1), (B,C,1) and (A,C,3).
Hope that helps
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 20 days, 21:01.]
Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/
Navigation:
[Reply to this message]
|