Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Boost Kruskal Minimum Spanning Tree

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Boost Kruskal Minimum Spanning Tree


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Boost Kruskal Minimum Spanning Tree
  • Date: Fri, 24 Oct 2014 11:25:15 +0200
  • Organization: GeometryFactory


Hi Jasmine,

A bug in the example, not in CGAL or the BGL.


When calling
boost::kruskal_minimum_spanning_tree(ft,
std::back_inserter(mst),
vertex_index_map(vertex_index_pmap));


the first argument must be ft, that is the filtered
graph where the infinite vertex is ignored (In the
example it was t instead of ft).

I fixed it in the code base for the next release.

Best,

Andreas


On 23/10/2014 07:23, jasmine2210 wrote:

Hello,

I'm trying to run CGAL with Boost Graph Library - Kruskal Minimum Spanning
Tree with my input. The code is exactly in this url:
https://doc.cgal.org/4.2/CGAL.CGAL.CGAL-and-the-Boost-Graph-Library/html/BGL_triangulation_2_2emst_8cpp-example.html

My input is

0. 0.
1. 1.
0. 2.
1. 0.

But when I run it, the output is not nice. This is the output of edges in
minimum spanning tree (EMST). Each line is an edge which is a pair of
points.

(0 6.95331e-310) - (0 0)
(1 1) - (1 0)
(1 1) - (0 2)

However, when I print the Delaunay Triangulation, the output is as expected.

(0 0) - (0 2)
(0 0) - (1 1)
(1 1) - (0 2)
(1 1) - (1 0)
(0 0) - (1 0)

I think it should be (0,0) in the first line in output of EMST. Moreover, I
don't think it's correct that the edge (0 0) - (0 0) is in the EMST. Could
you please let me know where is the root cause of my issue.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Boost-Kruskal-Minimum-Spanning-Tree-tp4659990.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


--
Andreas Fabri, PhD
Chief Officer, GeometryFactory
Editor, The CGAL Project

phone: +33.492.954.912 skype: andreas.fabri



Archive powered by MHonArc 2.6.18.

Top of Page