Re: How to visualize network



itschy wrote:
On 18 Jan., 23:31, Jensen Somers <jensen.som...@xxxxxxxxx> wrote:
PHP has support to create images, so my guess is - if I understand the
problem correctly - you'll just need to find a way to draw dots and
lines, making them thicker depending on the weight they have.

Not quite.
You missed the part, where I mentiond that I do not have any
coordinates of the nodes. Thus I'cant just draw them, cause I don't
know where. :)
What I seek is some solution, which finds a representation according
to the information I have about the edges (that is, connected or not,
and if, what weight/line length do they have).

E.g.:
I have three nodes A,B,C and 3 connections a(A,B,3), b(B,C,4), c(A,C,
5) (each with infos about from_node, to_node and weight/length.
In this szenario, there are only two possible ways to draw that
network correctly:
5
A-----C B
3\ /4 3/ \4
B A-----C
5

And their rotations.
I try to find some tool/algorithm which is able to do this (and draw
it) in php.
Tough luck I guess... :(

itschy

Didn't they teach you basic geometry at school?

three nodes with three paths, defines a unique shape, which is constant. It can be rotated and mirrored,without violating the original definition, but the shape remains constant.

To plot it, simply assume one point (A) is at 0,0, the next one - say 'B' is at the correct distance along the X axis, so in your case its co-ordinates are 3,0.

Solving the position of the third point C involves solving a pair of simultaneous quadratic equations. Cf Pythagoras and the dropping of perpendiculars.

Namely:-

Cx^2+Cy^2=(5)^2
(3-Cx)^2 +Cy^2=(4)^2

Now there are either two, or none, solutions for Cy as there always are for quadratics. One solution is the mirror of the other.

Now go solve it.

Its your homework, not mine.


.



Relevant Pages

  • Re: How to visualize network
    ... making them thicker depending on the weight they have. ... Thus I'cant just draw them, ... Graphics packages exists. ... http://www.php.net/~helly/php/ext/spl/classCachingRecursiveIterator.html Nice extends/implements visualisations, allthough not a full blown graph no, no 'circular' references/crosspoints. ...
    (comp.lang.php)
  • Re: How to visualize network
    ... itschy wrote: ... making them thicker depending on the weight they have. ... Thus I'cant just draw them, ... Graphics packages exists. ...
    (comp.lang.php)
  • Re: How to visualize network
    ... itschy wrote: ... Thus I'cant just draw them, ... Graphics packages exists. ... Php doesn't have a package to calculate the net loss in weight of a rutting elephant after sex, ...
    (comp.lang.php)
  • Re: How to visualize network
    ... making them thicker depending on the weight they have. ... Thus I'cant just draw them, ... Graphics packages exists. ... The mathematics of quadratics is well known. ...
    (comp.lang.php)
  • Re: How to visualize network
    ... making them thicker depending on the weight they have. ... Thus I'cant just draw them, ... simultaneous quadratic equations. ... They did not only teach me basic geometry in school, ...
    (comp.lang.php)