COIN-OR::LEMON - Graph Library

Opened 9 years ago

Closed 9 years ago

#347 closed enhancement (done)

Computing the total flow cost in DIMACS solver

Reported by: Peter Kovacs Owned by: Peter Kovacs
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 Peter Kovacs 9 years ago.

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by Peter Kovacs

Attachment: 347-9d380bf27194.patch added

comment:1 Changed 9 years ago by Peter Kovacs

Status: newassigned

See the patch [9d380bf27194] attached.

comment:2 Changed 9 years ago by Peter Kovacs

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

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

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 9 years ago by Alpar Juttner

Resolution: done
Status: assignedclosed

Replying to kpeter:

See the patch [9d380bf27194] attached.

It is in the main branch now.

Note: See TracTickets for help on using tickets.