Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rgraphviz doesn't seem to handle edge weights #4

Open
january3 opened this issue Mar 27, 2015 · 4 comments
Open

Rgraphviz doesn't seem to handle edge weights #4

january3 opened this issue Mar 27, 2015 · 4 comments

Comments

@january3
Copy link

Edge weights are important for layouts such as neato and fdp, but do not seem to be imported by Rgraphviz agopen() function. Graphs produced using the fdp layout, even if edges have different weights, have always the same edge length. Example:

graph <- new( "graphNEL", nodes= LETTERS[1:5], edgemode="undirected" )
graph <- addEdge( rep( "A", 4 ), LETTERS[2:5], graph, weights= 10^c( 1, 2, 3, 4 ) )
rag <- agopen( graph, "", layoutType= "fdp" )
plot(rag)

example_fdp

Compare with the equivalent graph produced from the following .dot file using the command fdp -Tpng example.dot -o example.png

digraph { 
  node [shape=ellipse];  
  // nodes
  A B C D E;
  // labelled, weighted edges
  A -> B[weight="0.1"];
  A -> C[weight="10"]; 
  A -> D[weight="100"]; 
  A -> E[weight="1000"]; 
}

blah

@kasperdanielhansen
Copy link
Owner

This looks like a bug. However, I have to point out that the two graphs are not identical - one is undirected, the other is not and the edge weights are slightly different. I don't know enough about the internals of fdp to know if this makes a difference, but it should be easy to test.

Nevertheless I do think it looks like a bug.

Just for the record: which version of Graphviz did you use for the command line example?

@january3
Copy link
Author

Hi Kasper, version 2.8.1

here is my sessionInfo:

R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=de_DE.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid stats graphics grDevices utils datasets methods
base

other attached packages:
[1] Rgraphviz_2.8.1 graph_1.42.0 tmod_0.9 pca3d_0.4
myfuncs_1.5 setwidth_1.0-3 colorout_0.9-9

loaded via a namespace (and not attached):
[1] beeswarm_0.1.6 BiocGenerics_0.10.0 igraph_0.7.1
parallel_3.1.2 rgl_0.95.1201 stats4_3.1.2 tools_3.1.2

On 27 March 2015 at 18:47, Kasper Daniel Hansen [email protected]
wrote:

This looks like a bug. However, I have to point out that the two graphs
are not identical - one is undirected, the other is not and the edge
weights are slightly different. I don't know enough about the internals of
fdp to know if this makes a difference, but it should be easy to test.

Nevertheless I do think it looks like a bug.

Just for the record: which version of Graphviz did you use for the command
line example?


Reply to this email directly or view it on GitHub
#4 (comment)
.

-------- January Weiner --------------------------------------

@kasperdanielhansen
Copy link
Owner

I meant command-line graphviz;, just do

fdp -V

Kasper

On Fri, Mar 27, 2015 at 2:47 PM, january3 [email protected] wrote:

Hi Kasper, version 2.8.1

here is my sessionInfo:

R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=de_DE.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid stats graphics grDevices utils datasets methods
base

other attached packages:
[1] Rgraphviz_2.8.1 graph_1.42.0 tmod_0.9 pca3d_0.4
myfuncs_1.5 setwidth_1.0-3 colorout_0.9-9

loaded via a namespace (and not attached):
[1] beeswarm_0.1.6 BiocGenerics_0.10.0 igraph_0.7.1
parallel_3.1.2 rgl_0.95.1201 stats4_3.1.2 tools_3.1.2

On 27 March 2015 at 18:47, Kasper Daniel Hansen [email protected]
wrote:

This looks like a bug. However, I have to point out that the two graphs
are not identical - one is undirected, the other is not and the edge
weights are slightly different. I don't know enough about the internals
of
fdp to know if this makes a difference, but it should be easy to test.

Nevertheless I do think it looks like a bug.

Just for the record: which version of Graphviz did you use for the
command
line example?


Reply to this email directly or view it on GitHub
<
#4 (comment)

.

-------- January Weiner --------------------------------------


Reply to this email directly or view it on GitHub
#4 (comment)
.

@january3
Copy link
Author

fdp - graphviz version 2.36.0 (20140111.2315)

On 27 March 2015 at 19:52, Kasper Daniel Hansen [email protected]
wrote:

I meant command-line graphviz;, just do

fdp -V

Kasper

On Fri, Mar 27, 2015 at 2:47 PM, january3 [email protected]
wrote:

Hi Kasper, version 2.8.1

here is my sessionInfo:

R version 3.1.2 (2014-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=de_DE.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=de_DE.UTF-8
[6] LC_MESSAGES=en_US.UTF-8 LC_PAPER=de_DE.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] grid stats graphics grDevices utils datasets methods
base

other attached packages:
[1] Rgraphviz_2.8.1 graph_1.42.0 tmod_0.9 pca3d_0.4
myfuncs_1.5 setwidth_1.0-3 colorout_0.9-9

loaded via a namespace (and not attached):
[1] beeswarm_0.1.6 BiocGenerics_0.10.0 igraph_0.7.1
parallel_3.1.2 rgl_0.95.1201 stats4_3.1.2 tools_3.1.2

On 27 March 2015 at 18:47, Kasper Daniel Hansen <
[email protected]>
wrote:

This looks like a bug. However, I have to point out that the two graphs
are not identical - one is undirected, the other is not and the edge
weights are slightly different. I don't know enough about the internals
of
fdp to know if this makes a difference, but it should be easy to test.

Nevertheless I do think it looks like a bug.

Just for the record: which version of Graphviz did you use for the
command
line example?


Reply to this email directly or view it on GitHub
<

#4 (comment)

.

-------- January Weiner --------------------------------------


Reply to this email directly or view it on GitHub
<
#4 (comment)

.


Reply to this email directly or view it on GitHub
#4 (comment)
.

-------- January Weiner --------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants