COIN-OR::LEMON - Graph Library

Opened 14 years ago

Closed 14 years ago

#371 closed defect (fixed)

Target graph is not cleared before graph copying

Reported by: Peter Kovacs Owned by: Peter Kovacs
Priority: critical Milestone: LEMON 1.3 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description (last modified by Peter Kovacs)

The target graph must be cleared before graph copying. The clear() function must be used in the DigraphCopySelector and GraphCopySelector classes before adding nodes and arcs/edges.

It is a question if build() is required to clear the graph or we should explicitly call clear() before build() for those structures that provides build() function.

Attachments (3)

371-bugfix-50446fbc0602.patch (1.1 KB) - added by Peter Kovacs 14 years ago.
371-test-99be8c4f5a60.patch (2.5 KB) - added by Peter Kovacs 14 years ago.
371-test-main-branch-b0fe90eb04d1.patch (4.2 KB) - added by Peter Kovacs 14 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 years ago by Peter Kovacs

Description: modified (diff)
Status: newassigned

Changed 14 years ago by Peter Kovacs

Changed 14 years ago by Peter Kovacs

Attachment: 371-test-99be8c4f5a60.patch added

Changed 14 years ago by Peter Kovacs

comment:2 Changed 14 years ago by Peter Kovacs

I attached three patches:

  • [50446fbc0602] is a bug fix that should be merged into all branches.
  • [99be8c4f5a60] extends the test file to check repeated copy as well. It is based on the above patch, it could be merged into all branches, but it is not critical.
  • [b0fe90eb04d1] contains further improvements for the test file, but it must be rebased on the top of the main branch after merging the above two patches. It uses more graph structures as target graph type, testing both methods of copying (List and Smart structures are built using addNode() and addEdge()/addArc(), but StaticDigraph is built using build()).

comment:3 in reply to:  2 ; Changed 14 years ago by Alpar Juttner

Replying to kpeter:

I attached three patches:

  • [50446fbc0602] is a bug fix that should be merged into all branches.
  • [99be8c4f5a60] extends the test file to check repeated copy as well. It is based on the above patch, it could be merged into all branches, but it is not critical.

I merged these two changesets together as [bb871cb8ac06]. Conceptually, a test should be written even easier than the fix itself.

  • [b0fe90eb04d1] contains further improvements for the test file, but it must be rebased on the top of the main branch after merging the above two patches.

Done, see [24b3f18ed9e2].

Is there anything to do with build()?

comment:4 in reply to:  3 Changed 14 years ago by Peter Kovacs

Replying to alpar:

Done, see [24b3f18ed9e2].

Thank you.

Is there anything to do with build()?

I don't think so. Currently, a build() function must clear the graph before building to support copying correctly, but I think, it is a natural request. Now the only graph structure that has a build() function is StaticDigraph, which works correctly.

So the ticket can be closed, as far as I see.

comment:5 Changed 14 years ago by Peter Kovacs

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.