Graphviz Issue Tracker
Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002402graphvizFdppublic2013-12-13 19:222013-12-16 17:47
Reportertrygub 
Assigned To 
PrioritynormalSeveritynormalReproducibilityalways
StatusnewResolutionopen 
PlatformPCOSFreeBSDOS Version9
Summary0002402: When trying to plot a graph using fdb empty plot is generated
DescriptionI really like fdp algorithm --- it is sometimes slower to run than other utilities in Graphviz but the results are excellent and I don't mind the wait. However, for some graphs it produces an image file that seems to contain no plot.

The formats I tried: png and svg

By "seems to contain no plot" I mean this: when viewing the result it appears to contain an empty page (no plot). The image files non-zero in size, and, when inspected in text editor, appear to be non-empty and valid structure.

Because of this I initially thought it is a viewer problem. I have tried loading svg in various svg viewers (eog, Inkscape, Firefox), then png --- eog, Firefox and Gimp --- with no luck. Loading the problematic file in eog results in "Could not load image _graphssFdp.sv -- image loading failed" message. Inkscake and Firefox open the file but display nothing.
Steps To Reproducefdp -Tsvg graphss.gv -o _graphssFdp.svg
Additional InformationI attach graphss.gv as an example file that gives rise to this problem. The files is by no means minimal, but I did not want to waste effort unless there is a clear need to reduce the input in size. The input file contains about 1,500 nodes and 2401 edges and describes an undirected graph.
TagsNo tags attached.
AUXILLARY-FILES
DATE-FIXED
FIX-COMMENT
FORMER-ID
INPUT-FILE
OUTPUT-FILE
STATUS-COMMENT
VERSION2.34.0
Attached Files? file icon graphss.gv [^] (32,241 bytes) 2013-12-13 19:22
? file icon _graphssFdp.svg [^] (1,037,264 bytes) 2013-12-13 19:24
? file icon _graphssSfdp.svg [^] (951,239 bytes) 2013-12-15 19:20
? file icon graphss_sfdp.svg [^] (927,277 bytes) 2013-12-16 12:26
? file icon graphss_sfdp_filled.svg [^] (929,038 bytes) 2013-12-16 12:28
gz file icon _graphssSfdpBSD.svg.gz [^] (154,319 bytes) 2013-12-16 16:56

- Relationships

-  Notes
User avatar (0000636)
erg (administrator)
2013-12-14 10:38

The immediate problem would appear to be the size of the final layout. If you look at the size given at the top of the svg file, you'll see width="948164906pt" height="1206845920pt", or roughly 330km x 428km. I'm surprised there was no warning message printed for the png output. The default scaling probably did kick in, but with the drawing so large, the scaled drawing would look empty.

I'll have to check what is going wrong. As a workaround, and in general for graphs with more than 1000 nodes, I'd suggest using sfdp, which is designed for larger graphs.
User avatar (0000637)
ellson (administrator)
2013-12-14 15:49

I think png autoscales to fit the largest supported dimensions.

Not sure why this doesn't happen for svg. Perhaps we didn't know that there was a limit? (400km! Wow!)

As Emden indicated:
    sfdp graphss.gv -Tsvg -o graphss.svg
    inkscape graphss.svg
works much faster
User avatar (0000640)
trygub (reporter)
2013-12-15 19:19

@erg: Re: "I'd suggest using sfdp, which is designed for larger graphs"

I've tried sfdp --- the results are poor. Perhaps I'm missing something? I attach an svg file produced using sfdp for this graph, but I guess you might have generated it yourself already if you advocate using sfdp for this graph?
User avatar (0000641)
ellson (administrator)
2013-12-16 12:24
edited on: 2013-12-16 12:25

Mmm, thats a mess! but I don't get the same result with the latest snapshot on Fedora. I see you're running on BSD? Did you build with pango, cairo, fontconfig, freetype?

I'll attach my results for:
    sfdp graphss.gv -Tsvg -o graphss_sfdp.svg
and
    sfdp graphss.gv -Tsvg -Nstyle=filled -Nfillcolor=white -o graphss_sfdp_filled.svg

User avatar (0000642)
erg (administrator)
2013-12-16 15:03

Check where you are getting sfdp from. The comment in your sfdp output indicates you are using the 2.26 version of sfdp, while the fdp output is 2.34.
User avatar (0000643)
trygub (reporter)
2013-12-16 15:53

@ellson Re: "I see you're running on BSD?"

FreeBSD 9.1-RELEASE-p7
graphviz-2.34.0

@ellson Re: "Did you build with pango, cairo, fontconfig, freetype?"

Looks like it --- found this in the build log:

===> graphviz-2.34.0 depends on package: libtool>=2.4 - found
===> graphviz-2.34.0 depends on shared library: libiconv.so.3 - found
===> graphviz-2.34.0 depends on shared library: jpeg - found
===> graphviz-2.34.0 depends on shared library: png15 - found
===> graphviz-2.34.0 depends on shared library: freetype - found
===> graphviz-2.34.0 depends on shared library: fontconfig - found
===> graphviz-2.34.0 depends on shared library: expat - found
===> graphviz-2.34.0 depends on shared library: gd - found
===> graphviz-2.34.0 depends on shared library: intl - found
===> graphviz-2.34.0 depends on shared library: ltdl.7 - found
===> graphviz-2.34.0 depends on shared library: glib-2.0 - found
===> graphviz-2.34.0 depends on shared library: pcre - found
===> graphviz-2.34.0 depends on shared library: pango-1.0 - found

No explicit mention of cairo in the above, but in the build lines that follow we are linking against it, it seems: -lpangocairo-1.0 -lpango-1.0 ?

Hope this helps.
User avatar (0000644)
trygub (reporter)
2013-12-16 16:42

@erg Re: "Check where you are getting sfdp from. The comment in your sfdp output indicates you are using the 2.26 version of sfdp, while the fdp output is 2.34."

Apologies --- the same erroneous behaviour was observed by me on an Ubuntu box I have access to. When I was trying to work out what's wrong I was comparing the outputs on both platforms. I must have uploaded the output from my Ubuntu sorties and not from the BSD box. The Ubuntu box description:

Linux 3.2.0-57-generic x86_64

dot -v
dot - graphviz version 2.26.3 (20100126.1600)

On Ubuntu sfdp produces the file I already uploaded, _graphssSfdp.svg, when I run

sfdp -Tsvg graphss.gv -o _graphssSfdp.svg



On BSD sfdp produces the file I'm about to upload, _graphssSfdpBSD.svg. Initially I was running sfdp indirectly, and didn't notice that it also writes to stderr the following message:

Error: remove_overlap: Graphviz not built with triangulation library

I've built gts

Path: /usr/ports/graphics/gts
Info: GNU Triangulated Surface Library

and reconfigured and rebuilt graphviz but it didn't pick it up, presumably because I need to do something special. Here's a stanza in Makefile that depends on ${PORT_OPTIONS:MSMYRNA}:

.if ${PORT_OPTIONS:MSMYRNA}
CONFIGURE_ARGS+= --with-gts=yes
LIB_DEPENDS+= gts:${PORTSDIR}/graphics/gts
.else
CONFIGURE_ARGS+= --without-gts
.endif

Where do I need to define that MSMYRNA so that gts is picked up? Apologies --- I've never configured packages on FreeBSD using ${PORT_OPTIONS:MSMYRNA} ...
User avatar (0000645)
erg (administrator)
2013-12-16 17:08

John can probably provide a better answer, but basically the availability of the gts library is determined when you run configure. It is set up to look for gts in obvious places. You can check your config.log file to find out why it failed. Normally, configure uses pkg-config to look for gts. In particular, it will look for gts.pc. You can try setting the environment variable PKG_CONFIG_PATH to tell it where to find the .pc file.

Or, you can circumvent all of this by telling configure explicitly where to look for the gts include file and library by setting the GTS_CFLAGS and GTS_LIBS environment variables before running configure. Run configure --help to check these options.

Or, you can go to http://www.cs.cmu.edu/~quake/triangle.html [^] and copy the files triangle.c and triangle.h into lib/sfdp, and re-run configure.

We recommend having one of the two triangle libraries installed, as they are used in various features, especially node overlap removal.
User avatar (0000646)
trygub (reporter)
2013-12-16 17:10

Sorry --- had to upload gz compressed svg, as access to graphviz.org today is a bit slow for some reason ... (but other sites are OK).

Overall, maybe I'm asking the wrong questions? fdb bombs, sfdp either silently produces strange result (Ubuntu) or signals about the need for gts but I can't easily satisfy it, given my poor knowledge of ports system (BSD) --- I can of course hack the makefile but I don't want to break the automatic updates of the ports tree on production machine so don't want to hack it just yet ...

What I really want to do is to visualize that graph --- I really liked how informative the output of fdp was for smaller graphs, but what would you advise I do with this one? Perhaps you could recommend some other algo I could use to visualize this graph? I need to visualize it so that I could see which edges need to be broken. In general, I am trying to split this graph into K subgraphs by breaking up to N edges guided by a cost function yet to be determined --- and I need to determine a good algorithm for doing that programmatically, so wanted to get some intuition for that first by viewing these graphs --- but perhaps such algorithm is already in textbooks and you know about it?
User avatar (0000647)
trygub (reporter)
2013-12-16 17:14

@erg Re: "the availability of the gts library is determined when you run configure"

Not on BSD I'm afraid.

I tried running "make config" in graphviz directory of the ports tree --- it didn't offer me an option to switch gts on ...

I need to get it going on FreeBSD ... I asked package maintainer to shed some light on this dependancy problem but I don't know how long it will take him to reply (if he is going to reply) ...
User avatar (0000648)
trygub (reporter)
2013-12-16 17:18

@elson Re: "graphss_sfdp.svg and graphss_sfdp_filled.svg"

Thanks for uploading these! Even if I get sfdp to work to be able to generate these myself, IMHO, they are not as pretty as what fdp produces --- there's too much node overlap --- I would prefer this graph to be much more "spread out" ...
Because of this overlap it is hard to assess and comment on the effectiveness of this visualization ...

Thanks again,
Sem
User avatar (0000649)
erg (administrator)
2013-12-16 17:22

It looks like the BSD lost track of the triangle option. This was introduced long ago.

By the way, what you are seeing is that fdp does overlap removal by default. For sfdp, you need to set -Goverlap=false to get the type of result you want.
User avatar (0000650)
erg (administrator)
2013-12-16 17:47

I don't know how this can be done in BSD, but basically, if you have installed the GTS library, you need to compile with -DHAVE_GTS and a -I flag giving the directory containing gts.h. This is only necessary for the neatogen and sfdpgen directories under lib.

For linking, when the neato plugin is made in plugin/neato_layout, there needs to be a -lgts plus a -L flag indicating where libgts can be found. Something also might be necessary when you build dot in cmd/dot, but it shouldn't be if the runtime uses plugins.

- Issue History
Date Modified Username Field Change
2013-12-13 19:22 trygub New Issue
2013-12-13 19:22 trygub File Added: graphss.gv
2013-12-13 19:24 trygub File Added: _graphssFdp.svg
2013-12-14 10:38 erg Note Added: 0000636
2013-12-14 15:49 ellson Note Added: 0000637
2013-12-15 19:19 trygub Note Added: 0000640
2013-12-15 19:20 trygub File Added: _graphssSfdp.svg
2013-12-16 12:24 ellson Note Added: 0000641
2013-12-16 12:25 ellson Note Edited: 0000641 View Revisions
2013-12-16 12:26 ellson File Added: graphss_sfdp.svg
2013-12-16 12:28 ellson File Added: graphss_sfdp_filled.svg
2013-12-16 15:03 erg Note Added: 0000642
2013-12-16 15:53 trygub Note Added: 0000643
2013-12-16 16:42 trygub Note Added: 0000644
2013-12-16 16:56 trygub File Added: _graphssSfdpBSD.svg.gz
2013-12-16 17:08 erg Note Added: 0000645
2013-12-16 17:10 trygub Note Added: 0000646
2013-12-16 17:14 trygub Note Added: 0000647
2013-12-16 17:18 trygub Note Added: 0000648
2013-12-16 17:22 erg Note Added: 0000649
2013-12-16 17:47 erg Note Added: 0000650


MantisBT 1.2.5[^]
Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker