Opened 13 years ago

Closed 13 years ago

#4087 closed Bugs (invalid)

boost::fruchterman_reingold_force_directed_layout fails compiling

Reported by: Wolfgang Forstmeier <wolfgang.forstmeier@…> Owned by: Jeremiah Willcock
Milestone: Boost 1.43.0 Component: graph
Version: Boost 1.42.0 Severity: Showstopper
Keywords: Cc:

Description

After I have tried to build a small example for running layout algorithm I have found out that boost::fruchterman_reingold_force_directed_layout fails compiling of source code.

I have used following example: http://www.systut.com/?p=24095

Compile error and source code is attached as seperate file.

Attachments (1)

fruchterman_reingold_force_directed_layout error.txt (8.1 KB ) - added by Wolfgang Forstmeier <wolfgang.forstmeier@…> 13 years ago.

Download all attachments as: .zip

Change History (4)

by Wolfgang Forstmeier <wolfgang.forstmeier@…>, 13 years ago

comment:1 by Wolfgang Forstmeier <wolfgang.forstmeier@…>, 13 years ago

I forgot to add following details:

OS: Windows XP Compiler: Visual Studio 2005 SP2 Boost version: 1.42.0

comment:2 by Jeremiah Willcock, 13 years ago

Owner: changed from Andrew Sutton to Jeremiah Willcock

Some of the interfaces changed in more recent versions of Boost. The F-R example you posted seems to use the new interface, though, but the K-K one doesn't. I'll take a look later today, though.

comment:3 by Jeremiah Willcock, 13 years ago

Resolution: invalid
Status: newclosed

The F-R function requires a displacement map or a vertex index map (used to create an internal displacement map). Adding boost::vertex_index_map(vertexIdMap) as the last argument to boost::fruchterman_reingold_force_directed_layout makes the code work. By the way, vertex indices need to be numbers from 0 to num_vertices(g)-1, and so the numbers you are putting into that property map have an incorrect range.

Note: See TracTickets for help on using tickets.