COIN-OR::LEMON - Graph Library

Opened 7 years ago

Closed 6 years ago

#382 closed task (done)

LGF without arc maps

Reported by: kpeter Owned by: deba
Priority: major Milestone: LEMON 1.3 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

Arc maps are not obligatory in LGF. However, it is problematic, if you do not specify any arc maps. If you only write an empty line instead of map names, the reader will consider the first arc definition as map names and fails to read the second arc definition line (missing columns).

I realized that if you write a single @ sign instead of the map names, then the reader handles it correctly. If this behavior is acceptable, then we should write it in the LGF documentation and maybe in the tutorial, too.

Attachments (1)

801f8c1c86b5.patch (6.1 KB) - added by alpar 6 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 in reply to: ↑ description Changed 7 years ago by alpar

Replying to kpeter:

Arc maps are not obligatory in LGF. However, it is problematic, if you do not specify any arc maps. If you only write an empty line instead of map names, the reader will consider the first arc definition as map names and fails to read the second arc definition line (missing columns).

I realized that if you write a single @ sign instead of the map names, then the reader handles it correctly. If this behavior is acceptable, then we should write it in the LGF documentation and maybe in the tutorial, too.

I think it is an acceptable solution.

comment:2 Changed 7 years ago by kpeter

Okay. Let's improve the documentation.

comment:3 Changed 6 years ago by kpeter

It seems that I was wrong. If you write a single @ letter instead of map names, then the reader can read the file, but it finds the arcs/edges section to be empty. So it is not a solution for the problem currently.

Changed 6 years ago by alpar

comment:4 Changed 6 years ago by alpar

The attached changeset [801f8c1c86b5] implements arcs sections without arc maps. A single '-' character in the header line indicates it.

Lgf doc is yet to be updated.

Could you please review the changes?

comment:5 Changed 6 years ago by deba

In my opinion it's a reasonable workaround for the problem.

Minor remarks:

  • The indentation does not match to the remaining part of the file lgf_reader.h.
  • It's good that there are tests for LGF reader.
  • It would be good to add documentation to the lgf.dox.

comment:6 Changed 6 years ago by alpar

  • Resolution set to done
  • Status changed from new to closed

[54464584b157] is the same as 801f8c1c86b5.patch, fixes the indentation and and a section about this feature to the dox page describing the lgf format.

The changeset has been merged to branches 1.0, 1.1, 1.2 and main.

Note: See TracTickets for help on using tickets.