How to visualize network
am 18.01.2008 22:06:58 von busnet
Hi.
I have a couple of nodes (just ids, no coordinates whatsoever) and
links betweens them (weighted).
Is there any existing solution to visualize this network in php?
Thanks
itschy
Re: How to visualize network
am 18.01.2008 23:22:28 von ivansanchez-alg
itschy wrote:
> I have a couple of nodes (just ids, no coordinates whatsoever) and
> links betweens them (weighted).
> Is there any existing solution to visualize this network in php?
You have to ask yourself the following question:
Is there any existing solution to visualize this network in HTML?
Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
El tiempo libre es más volátil que el éter...
Re: How to visualize network
am 18.01.2008 23:31:30 von Jensen Somers
Hello,
itschy wrote:
> Hi.
>
> I have a couple of nodes (just ids, no coordinates whatsoever) and
> links betweens them (weighted).
> Is there any existing solution to visualize this network in php?
>
> Thanks
>
> itschy
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.
I'm sure some examples exist, but I can't really name one to be honest.
- Jensen
Re: How to visualize network
am 18.01.2008 23:46:58 von busnet
On 18 Jan., 23:31, Jensen Somers 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
Re: How to visualize network
am 19.01.2008 17:19:22 von Courtney
itschy wrote:
> On 18 Jan., 23:31, Jensen Somers 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.
Re: How to visualize network
am 19.01.2008 19:08:32 von Luuk
"itschy" schreef in bericht
news:58f6331e-c13b-4226-a64c-9f7bc1ea8726@v67g2000hse.google groups.com...
> On 18 Jan., 23:31, Jensen Somers 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
aaah, you mean something like:
http://www.graphviz.org/Gallery/directed/hello.html
this is a sample with nodes 'hello' and 'world'
but this sollution does not give you weight...
(see also: http://www.graphviz.org/webdot/basic.html )
and, of course, this is not a PHP solution...
Re: How to visualize network
am 19.01.2008 19:23:35 von busnet
On 19 Jan., 17:19, The Natural Philosopher wrote:
> itschy wrote:
> > On 18 Jan., 23:31, Jensen Somers 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.
Thanks for teaching me.
Now, have you read anything I wrote?
In short words i will summarize:
0. They did not only teach me basic geometry in school, but also
analytical geometry, graph theory and such in university.
1. I try to find an EXISTING solution not write my own.
2. Jensen Somers misunderstood my initial post, so I clarified, what
kind of solution I seek. I described to him exactly what you did to me
(in a visual way).
3. I know well how to do it, I wanted to know if it was done before
(because with all the drwaing stuff it is not worth it to implement it
by myself)
4. Your answer is still welcome, maybe someone searching and finding
this thread can use it. but next time please don't assume everyone
else is stupid! :)
Re: How to visualize network
am 19.01.2008 19:26:16 von busnet
On 19 Jan., 19:08, "Luuk" wrote:
> "itschy" schreef in berichtnews:58f6331e-c13b-4226-a64c-9f7bc1ea8726@v67g2000hse .googlegroups.com...
>
>
>
> > On 18 Jan., 23:31, Jensen Somers 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
>
> aaah, you mean something like:http://www.graphviz.org/Gallery/directed/hello.html
> this is a sample with nodes 'hello' and 'world'
> but this sollution does not give you weight...
> (see also:http://www.graphviz.org/webdot/basic.html)
>
> and, of course, this is not a PHP solution...
Thanks for your answer.
I know the dot package, actually wrote my master thesis using it, but
as you said, its not a php solution. :(
To anticipate the next answer in this thread: I know about cgi etc,
but I do not have any rights on the server this is supposed to run, so
i search a PURE php solution.
Re: How to visualize network
am 19.01.2008 19:47:00 von Luuk
"itschy" schreef in bericht
news:f3021843-6e89-4177-aaf1-078582ec9197@i7g2000prf.googleg roups.com...
> On 19 Jan., 19:08, "Luuk" wrote:
>> "itschy" schreef in
>> berichtnews:58f6331e-c13b-4226-a64c-9f7bc1ea8726@v67g2000hse .googlegroups.com...
>>
>>
>>
>> > On 18 Jan., 23:31, Jensen Somers 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
>>
>> aaah, you mean something
>> like:http://www.graphviz.org/Gallery/directed/hello.html
>> this is a sample with nodes 'hello' and 'world'
>> but this sollution does not give you weight...
>> (see also:http://www.graphviz.org/webdot/basic.html)
>>
>> and, of course, this is not a PHP solution...
>
> Thanks for your answer.
> I know the dot package, actually wrote my master thesis using it, but
> as you said, its not a php solution. :(
>
> To anticipate the next answer in this thread: I know about cgi etc,
> but I do not have any rights on the server this is supposed to run, so
> i search a PURE php solution.
as you know the stuff.....
and you know php.net
it took me 5 mins to create this:
header("Content-type: image/png");
$im = @imagecreate(110, 120)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
//imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imageline($im, 10,10, 100, 10, $text_color);
imageline($im, 10,10, 50, 110, $text_color);
imageline($im, 100,10, 50, 110, $text_color);
imagepng($im);
imagedestroy($im);
?>
which is a nice triangular... ;-)
(thanks to the docs..!!!)
i whish you suc6..
Re: How to visualize network
am 19.01.2008 20:04:17 von busnet
On 19 Jan., 19:47, "Luuk" wrote:
> "itschy" schreef in berichtnews:f3021843-6e89-4177-aaf1-078582ec9197@i7g2000prf. googlegroups.com...
>
>
>
> > On 19 Jan., 19:08, "Luuk" wrote:
> >> "itschy" schreef in
> >> berichtnews:58f6331e-c13b-4226-a64c-9f7bc1ea8726@v67g2000hse .googlegroups.com...
>
> >> > On 18 Jan., 23:31, Jensen Somers 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
>
> >> aaah, you mean something
> >> like:http://www.graphviz.org/Gallery/directed/hello.html
> >> this is a sample with nodes 'hello' and 'world'
> >> but this sollution does not give you weight...
> >> (see also:http://www.graphviz.org/webdot/basic.html)
>
> >> and, of course, this is not a PHP solution...
>
> > Thanks for your answer.
> > I know the dot package, actually wrote my master thesis using it, but
> > as you said, its not a php solution. :(
>
> > To anticipate the next answer in this thread: I know about cgi etc,
> > but I do not have any rights on the server this is supposed to run, so
> > i search a PURE php solution.
>
> as you know the stuff.....
>
> and you know php.net
>
> it took me 5 mins to create this:
>
> header("Content-type: image/png");
> $im = @imagecreate(110, 120)
> or die("Cannot Initialize new GD image stream");
> $background_color = imagecolorallocate($im, 0, 0, 0);
> $text_color = imagecolorallocate($im, 233, 14, 91);
> //imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
> imageline($im, 10,10, 100, 10, $text_color);
> imageline($im, 10,10, 50, 110, $text_color);
> imageline($im, 100,10, 50, 110, $text_color);
> imagepng($im);
> imagedestroy($im);
> ?>
>
> which is a nice triangular... ;-)
> (thanks to the docs..!!!)
>
> i whish you suc6..
Luuk, please explain to me how you do that without ANY explicit
coordinates, like 10,10,100,10!
Please, everybody, READ what I write! cheers
Re: How to visualize network
am 19.01.2008 20:29:25 von Luuk
"itschy" schreef in bericht
news:2ff63e42-9e07-44cf-8c84-98ecfd2a9f22@s12g2000prg.google groups.com...
> On 19 Jan., 19:47, "Luuk" wrote:
>> "itschy" schreef in
>> berichtnews:f3021843-6e89-4177-aaf1-078582ec9197@i7g2000prf. googlegroups.com...
>>
>>
>>
>> > On 19 Jan., 19:08, "Luuk" wrote:
>> >> "itschy" schreef in
>> >> berichtnews:58f6331e-c13b-4226-a64c-9f7bc1ea8726@v67g2000hse .googlegroups.com...
>>
>> >> > On 18 Jan., 23:31, Jensen Somers 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
>>
>> >> aaah, you mean something
>> >> like:http://www.graphviz.org/Gallery/directed/hello.html
>> >> this is a sample with nodes 'hello' and 'world'
>> >> but this sollution does not give you weight...
>> >> (see also:http://www.graphviz.org/webdot/basic.html)
>>
>> >> and, of course, this is not a PHP solution...
>>
>> > Thanks for your answer.
>> > I know the dot package, actually wrote my master thesis using it, but
>> > as you said, its not a php solution. :(
>>
>> > To anticipate the next answer in this thread: I know about cgi etc,
>> > but I do not have any rights on the server this is supposed to run, so
>> > i search a PURE php solution.
>>
>> as you know the stuff.....
>>
>> and you know php.net
>>
>> it took me 5 mins to create this:
>>
>> header("Content-type: image/png");
>> $im = @imagecreate(110, 120)
>> or die("Cannot Initialize new GD image stream");
>> $background_color = imagecolorallocate($im, 0, 0, 0);
>> $text_color = imagecolorallocate($im, 233, 14, 91);
>> //imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
>> imageline($im, 10,10, 100, 10, $text_color);
>> imageline($im, 10,10, 50, 110, $text_color);
>> imageline($im, 100,10, 50, 110, $text_color);
>> imagepng($im);
>> imagedestroy($im);
>> ?>
>>
>> which is a nice triangular... ;-)
>> (thanks to the docs..!!!)
>>
>> i whish you suc6..
>
> Luuk, please explain to me how you do that without ANY explicit
> coordinates, like 10,10,100,10!
> Please, everybody, READ what I write! cheers
you dont need to know,
as 'the philosopher' said: "To plot it, simply assume one point (A) is at
0,0"
or, as i did, asume its at (10,10)
you can posistion the second node anywhere YOU like, so in my example (100,
10)
and when the third node is mention, you have to calculate where you should
put this node...(based on you knowledge)
[[knowledge of itschy: I have three nodes A,B,C and 3 connections a(A,B,3),
b(B,C,4), c(A,C,> 5) ]]
and i think i did READ what you WROTE, but i dont think you UNDERSTAND what
you ASK ??
;-)
Re: How to visualize network
am 19.01.2008 20:57:34 von Courtney
itschy wrote:
> On 19 Jan., 17:19, The Natural Philosopher wrote:
>> itschy wrote:
>>> On 18 Jan., 23:31, Jensen Somers 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.
>
> Thanks for teaching me.
> Now, have you read anything I wrote?
> In short words i will summarize:
> 0. They did not only teach me basic geometry in school, but also
> analytical geometry, graph theory and such in university.
> 1. I try to find an EXISTING solution not write my own.
> 2. Jensen Somers misunderstood my initial post, so I clarified, what
> kind of solution I seek. I described to him exactly what you did to me
> (in a visual way).
> 3. I know well how to do it, I wanted to know if it was done before
> (because with all the drwaing stuff it is not worth it to implement it
> by myself)
> 4. Your answer is still welcome, maybe someone searching and finding
> this thread can use it. but next time please don't assume everyone
> else is stupid! :)
I don't assume. I go on the evidence.
Maths packages exist.
Graphics packages exists.
The mathematics of quadratics is well known.
So all it needs s an unstupid unlazy person to put them all together.
Php doesn't have a package to calculate the net loss in weight of a
rutting elephant after sex, either.
If you want soenmthing that obscure, write it.
Re: How to visualize network
am 20.01.2008 02:13:40 von busnet
On 19 Jan., 20:57, The Natural Philosopher wrote:
> itschy wrote:
> > On 19 Jan., 17:19, The Natural Philosopher wrote:
> >> itschy wrote:
> >>> On 18 Jan., 23:31, Jensen Somers 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.
>
> > Thanks for teaching me.
> > Now, have you read anything I wrote?
> > In short words i will summarize:
> > 0. They did not only teach me basic geometry in school, but also
> > analytical geometry, graph theory and such in university.
> > 1. I try to find an EXISTING solution not write my own.
> > 2. Jensen Somers misunderstood my initial post, so I clarified, what
> > kind of solution I seek. I described to him exactly what you did to me
> > (in a visual way).
> > 3. I know well how to do it, I wanted to know if it was done before
> > (because with all the drwaing stuff it is not worth it to implement it
> > by myself)
> > 4. Your answer is still welcome, maybe someone searching and finding
> > this thread can use it. but next time please don't assume everyone
> > else is stupid! :)
>
> I don't assume. I go on the evidence.
>
> Maths packages exist.
> Graphics packages exists.
> The mathematics of quadratics is well known.
>
> So all it needs s an unstupid unlazy person to put them all together.
>
> Php doesn't have a package to calculate the net loss in weight of a
> rutting elephant after sex, either.
>
> If you want soenmthing that obscure, write it.
So, the answer to my question would be:
"No, it doesn't exist"
All I wanted to know...
PS: I have to admit I never wondered about that elephant thing ;)
Re: How to visualize network
am 20.01.2008 03:12:44 von Courtney
itschy wrote:
> On 19 Jan., 20:57, The Natural Philosopher wrote:
>> itschy wrote:
>>> On 19 Jan., 17:19, The Natural Philosopher wrote:
>>>> itschy wrote:
>>>>> On 18 Jan., 23:31, Jensen Somers 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.
>>> Thanks for teaching me.
>>> Now, have you read anything I wrote?
>>> In short words i will summarize:
>>> 0. They did not only teach me basic geometry in school, but also
>>> analytical geometry, graph theory and such in university.
>>> 1. I try to find an EXISTING solution not write my own.
>>> 2. Jensen Somers misunderstood my initial post, so I clarified, what
>>> kind of solution I seek. I described to him exactly what you did to me
>>> (in a visual way).
>>> 3. I know well how to do it, I wanted to know if it was done before
>>> (because with all the drwaing stuff it is not worth it to implement it
>>> by myself)
>>> 4. Your answer is still welcome, maybe someone searching and finding
>>> this thread can use it. but next time please don't assume everyone
>>> else is stupid! :)
>> I don't assume. I go on the evidence.
>>
>> Maths packages exist.
>> Graphics packages exists.
>> The mathematics of quadratics is well known.
>>
>> So all it needs s an unstupid unlazy person to put them all together.
>>
>> Php doesn't have a package to calculate the net loss in weight of a
>> rutting elephant after sex, either.
>>
>> If you want soenmthing that obscure, write it.
>
> So, the answer to my question would be:
> "No, it doesn't exist"
The astounding question I have, is whatever made you think it would?
I can't think of a single application for such a program.
> All I wanted to know...
>
> PS: I have to admit I never wondered about that elephant thing ;)
Well I never wondered about drawing a shape with three co-ordinates
defined in the way yours are.
Re: How to visualize network
am 20.01.2008 11:29:43 von Toby A Inkster
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/
Re: How to visualize network
am 20.01.2008 13:29:22 von luiheidsgoeroe
On Sun, 20 Jan 2008 03:12:44 +0100, The Natural Philosopher wrot=
e:
> itschy wrote:
>> On 19 Jan., 20:57, The Natural Philosopher wrote:
>>> itschy wrote:
>>>> On 19 Jan., 17:19, The Natural Philosopher wrote:
>>>>> itschy wrote:
>>>>>> On 18 Jan., 23:31, Jensen Somers wrote:=
>>>>>>> PHP has support to create images, so my guess is - if I understa=
nd =
>>>>>>> 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 accord=
ing
>>>>>> 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 d=
raw
>>>>>> 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 i=
ts
>>>>> 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 o=
f
>>>>> perpendiculars.
>>>>> Namely:-
>>>>> Cx^2+Cy^2=3D(5)^2
>>>>> (3-Cx)^2 +Cy^2=3D(4)^2
>>>>> Now there are either two, or none, solutions for Cy as there alway=
s =
>>>>> are
>>>>> for quadratics. One solution is the mirror of the other.
>>>>> Now go solve it.
>>>>> Its your homework, not mine.
>>>> Thanks for teaching me.
>>>> Now, have you read anything I wrote?
>>>> In short words i will summarize:
>>>> 0. They did not only teach me basic geometry in school, but also
>>>> analytical geometry, graph theory and such in university.
>>>> 1. I try to find an EXISTING solution not write my own.
>>>> 2. Jensen Somers misunderstood my initial post, so I clarified, wha=
t
>>>> kind of solution I seek. I described to him exactly what you did to=
me
>>>> (in a visual way).
>>>> 3. I know well how to do it, I wanted to know if it was done before=
>>>> (because with all the drwaing stuff it is not worth it to implement=
it
>>>> by myself)
>>>> 4. Your answer is still welcome, maybe someone searching and findin=
g
>>>> this thread can use it. but next time please don't assume everyone
>>>> else is stupid! :)
>>> I don't assume. I go on the evidence.
>>>
>>> Maths packages exist.
>>> Graphics packages exists.
>>> The mathematics of quadratics is well known.
>>>
>>> So all it needs s an unstupid unlazy person to put them all together=
..
>>>
>>> Php doesn't have a package to calculate the net loss in weight of a
>>> rutting elephant after sex, either.
>>>
>>> If you want soenmthing that obscure, write it.
>> So, the answer to my question would be:
>> "No, it doesn't exist"
>
> The astounding question I have, is whatever made you think it would?
>
> I can't think of a single application for such a program.
Euhm, this one for instance: =
http://www.php.net/~helly/php/ext/spl/classCachingRecursiveI terator.html=
=
Nice extends/implements visualisations, allthough not a full blown graph=
=
no, no 'circular' references/crosspoints. Created with Doxygen BTW.
>> All I wanted to know...
>> PS: I have to admit I never wondered about that elephant thing ;)
>
> Well I never wondered about drawing a shape with three co-ordinates =
> defined in the way yours are.
Well, I can think of several reasons why you'd want to visualise a graph=
=
like this one. The implementation of such a thing is as you indicated =
relatively straight forward (graphics & some math), allthough a lot of =
work to do right (image constraints/nodes are unfortunately not points b=
ut =
have their own dimensions). I would have assumed someone made those in P=
HP =
allready, apparantly not (at least, I don't know any, and nobody else =
seems to). The usual choice for problems like this, JPGraph, doesn't see=
m =
to have this.
-- =
Rik Wasmus
Re: How to visualize network
am 20.01.2008 13:31:45 von busnet
On 20 Jan., 11:29, Toby A Inkster
wrote:
> 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.
Thank you for your backup. :)
> Unless the OP is wedded to PHP, I think he should check out Perl's
> Graph::Easy module
Interesting.
But sadly, I can not use perl on that server, but I'm stuck to php. :(
> 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).
The weights actually represent the distance between two geographic
points, so the problem you imply should not occur while I operate
inside the bounds of physics. :)