| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Hi all. Is there an easy way to print out an adjacency list (for example: [[1,2],[1,3],[1,4],[1,5],[2,3],[2,4],[3,4],[4,5]]) as a graph? I use SWI-Prolog. Thanks in advance. =) |
|
#2
| |||
| |||
| On 2008-07-04, HeaD <a_ieloNO@NOvirgilio.it> wrote: > Hi all. Is there an easy way to print out an adjacency list (for > example: [[1,2],[1,3],[1,4],[1,5],[2,3],[2,4],[3,4],[4,5]]) as a graph? > I use SWI-Prolog. > > Thanks in advance. =) See the graphviewer demo from XPCE. Type ?- manpce. Then use File/Demo programs, select 'GraphViewer'. You can run it from there or fetch the source and tailor it to suit your needs. Alternatively, write a file for graphviz (dot) and run that. Enjoy --- Jan |
|
#3
| |||
| |||
| Jan Wielemaker ha scritto: > > See the graphviewer demo from XPCE. Type > > ?- manpce. > > Then use File/Demo programs, select 'GraphViewer'. You can > run it from there or fetch the source and tailor it to suit > your needs. > > Alternatively, write a file for graphviz (dot) and run that. > > Enjoy --- Jan Thank you Jan! I've just tried out the graph_viewer, but I'm a prolog newbie, is not so simple for me and i cannot understand how it works. I need someting easier. Is there an easier XPCE implementation for that? I'll try graphviz. too, thanks. |
|
#4
| |||
| |||
| On 2008-07-04, HeaD <a_ieloNO@NOvirgilio.it> wrote: > Jan Wielemaker ha scritto: >> >> See the graphviewer demo from XPCE. Type >> >> ?- manpce. >> >> Then use File/Demo programs, select 'GraphViewer'. You can >> run it from there or fetch the source and tailor it to suit >> your needs. >> >> Alternatively, write a file for graphviz (dot) and run that. >> >> Enjoy --- Jan > > Thank you Jan! > > I've just tried out the graph_viewer, but I'm a prolog newbie, is not so > simple for me and i cannot understand how it works. I need someting > easier. Is there an easier XPCE implementation for that? It shouldn't be that hard to find the bits collecting the graph and change them to your needs. Sure it can be done a lot shorter if you remove the menus, user interaction and simplify the nodes. That is left as an excercise to the user though :-) > I'll try graphviz. too, thanks. That will be comparable in complexity if you don't know graphviz syntax. --- Jan |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.