about boost graph library -- subgraph
Hi, I am new here. I recently downloaded the boost library from www.boost.org. I need to use the "subgraph" function in the library. I tried to run the example file "subgraph.cpp", but the running result was different from what was given in the file. Below is my running result and sample output: //my result: G0: 0 --> 1 1 --> 2 3 2 --> 5 3 --> 4 --> 1 5 5 --> 3 0(0,1) 1(1,2) 2(1,3) 6(2,5) 3(4,1) 4(4,5) 5(5,3) G1: 0 --> 2 1 --> 2 2 --> 6(0,2) 4(1,2) G2: 0 --> 1 1 --> 0(0,1) //sample output G0: 0 --> 1 1 --> 2 3 2 --> 5 3 --> 4 --> 1 5 5 --> 3 0(0,1) 1(1,2) 2(1,3) 6(2,5) 3(4,1) 4(4,5) 5(5,3) G1: 2 --> 5 4 --> 5 5 --> 6(2,5) 4(4,5) G2: 0 --> 1 1 --> 0(0,1) //====================================================== Basically what happened was that the vertex indices of the subgraph G1 in my output are child's local indices, however, the vertex indices of the subgraph G1 in the sample output is parent's global indices. Can somebody explain this? Is it a bug in the boost code? Thanks very much, Qiaofeng
It seems that the subgraph.expected file contents is wrong. The actual results are correct. Be warned that the base graph's internal properties are not available in a child subgraph. Such graphs have internal properties, but only contain the data that their default constructor provides. qyang@cs.ucr.edu wrote:
Hi,
I am new here. I recently downloaded the boost library from www.boost.org. I need to use the "subgraph" function in the library. I tried to run the example file "subgraph.cpp", but the running result was different from what was given in the file. Below is my running result and sample output:
//my result:
G0: 0 --> 1 1 --> 2 3 2 --> 5 3 --> 4 --> 1 5 5 --> 3 0(0,1) 1(1,2) 2(1,3) 6(2,5) 3(4,1) 4(4,5) 5(5,3)
G1: 0 --> 2 1 --> 2 2 --> 6(0,2) 4(1,2)
G2: 0 --> 1 1 --> 0(0,1)
//sample output
G0: 0 --> 1 1 --> 2 3 2 --> 5 3 --> 4 --> 1 5 5 --> 3 0(0,1) 1(1,2) 2(1,3) 6(2,5) 3(4,1) 4(4,5) 5(5,3)
G1: 2 --> 5 4 --> 5 5 --> 6(2,5) 4(4,5)
G2: 0 --> 1 1 --> 0(0,1)
//====================================================== Basically what happened was that the vertex indices of the subgraph G1 in my output are child's local indices, however, the vertex indices of the subgraph G1 in the sample output is parent's global indices. Can somebody explain this? Is it a bug in the boost code?
Thanks very much, Qiaofeng
participants (2)
-
Jeffrey Holle
-
qyang@cs.ucr.edu