COIN-OR::LEMON - Graph Library

Opened 8 years ago

Closed 8 years ago

#347 closed enhancement (done)

Computing the total flow cost in DIMACS solver

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

Description

The DIMACS solver tool is usually tested by users who would like to get initial information about the performance of LEMON. "Bad results" were reported sometimes for min. cost flow problems. These were overflow problems (using int, the default value type) but just when the total flow cost is calculated, not in the algorithm itself. Of course, the used number type can be changed with command line arguments, but it is not clear for the users that this might be the problem. On the other hand, using e.g. long long instead of int makes the algorihtm slower although it would not be necessary.

However, the min cost flow solvers provide a template variant of totalCost(). The attached patch calls this template function with long long if the values type is int. This avoids such overflow problems and so helps making the initial impressions of some users better.

Attachments (1)

347-9d380bf27194.patch (2.0 KB) - added by kpeter 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by kpeter

comment:1 follow-up: Changed 8 years ago by kpeter

  • Status changed from new to assigned

See the patch [9d380bf27194] attached.

comment:2 follow-up: Changed 8 years ago by kpeter

Btw. why do we use cerr instead of cout to report the results in the dimacs solver?

comment:3 in reply to: ↑ 2 Changed 8 years ago by alpar

Replying to kpeter:

Btw. why do we use cerr instead of cout to report the results in the dimacs solver?

Probably because the solver may also want to output the solution, which could go to stdout bu default. I'm not sure if it really makes sense.

comment:4 in reply to: ↑ 1 Changed 8 years ago by alpar

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

Replying to kpeter:

See the patch [9d380bf27194] attached.

It is in the main branch now.

Note: See TracTickets for help on using tickets.