Opened 12 years ago

Closed 9 years ago

#40 closed task (fixed)

Embedding CBC to the user's applications

Reported by: mserg Owned by: somebody
Priority: major Component: component1
Version: Keywords:
Cc:

Description

Embedding CBC to the application is not so easy. I tried to use a “cbcSolve.exe” and dll-library on windows-platform. Maybe I am needed in good advice against the Cbc is is needed in changing…

*Using “exe” schema:

  1. User application is create the mps-file in the temporary directory.
  2. User application is starting the cbcSolve.exe with follow parameters:
    1. -directory [Temporary folder]
    2. –import [mps-file]
    3. -message on
    4. user’s solving options
    5. –solve
    6. –solu [Results file]

The output of cbcSolve.exe is redirected to the log-file.

  1. User application is waiting when cbcSolve.exe is completed. During this time user application:
    1. Periodically read the tile of log-file and showing it to user.
    2. Grepping the the readied log-file rows and finding in its solution bounds and number of nodes and iterations.
    3. If user want to stop the solving process or halting it then ctrl+c is sended to cbcSolve.exe window. ctrl+c is send one time for stopping and twice for halting.
  2. User application read the results from file and show its to user.

This scheme has several problems. Some of its can be reproduced by special debugging program (see http://np-soft.ru/downloads/embedding.zip). Unpack this archive and put to the same directory cbcSolve.exe.

  1. The informing user about solving process is delayed because output in CBC is not flushed. For example run EmbeddedCbc?.exe from archive, open and run “LifeGameCp?.mps“. There is the long output delay after message “Cbc0038I After … seconds - Feasibility pump exiting - took … seconds” is happen…
  2. Accuracy in result file is too low. For example, run “BigVar?.mps” in EmbeddedCbc?.exe. We have the zeros instead of right digits in x1 and x2 result values. The low accuracy of objective bounds in messages in the log is problem too. As rule I use the objective with the “infeasibility” variables and optimizing variables. “Infeasibility” variables have the big factors and optimizing variables have the relative small factors in objective. So, the optimizing variables part has a chance to be lost because objective value is shown “rounded”.
  3. The breaking (stopping) and halting of execution of cbcSolve.exe by “ctrl+c” is not stable. It is very nice to have the semaphore-files to breaking and halting executing of cbcSolve.exe. Periodically cbcSolve.exe should check the existence of those files and break or halt if it needed. Also in that case “black window” of cbcSolve.exe can be hided…

Using “dll” schema. In version 2.0 I have found the dll interface. But I not found how to add cut generators and heuristics by interface. It is nice to have the “dll” interface + “cbcSolve.exe” interface (cut generators and heuristics) + branch and cut part of “cbcSolve.exe”. In other words it is very convenient to have cbcSolve as a dll + model putting, result reading and event handling pointers from current dll interface. It gives the possibility to exchanging between the user application and solver without using the files.

Change History (4)

comment:1 in reply to: ↑ description Changed 12 years ago by entriken

This ticket refers to both cbcSolve.exe and the cbc DLL. From my reading, the text seems to be a collection of feature requests, mostly for the executable. I cannot see anything describing what would be a bug.

The part having to do with the DLL (for which I am responsible) seems to be a feature request for linking in cut generators and branching heuristics. I should think that this can be achieved readily by one or all of the following methods:

1) Expand the exported symbols to include the C++ objects and methods for these features.
2) Extend the appropriate C++ objects to form customized versions for these features.
3) Add C library calls to the file 'Cbc/src/Cbc_C_Interface.cpp' to handle these features.

These methods can be done by a competent C++ programmer using the VS project included in the distribution. I personally do not have need of features for adding cuts or branching heuristics at this time, but welcome submissions for feature enhancements.

All the best,

Robert Entriken

comment:2 Changed 12 years ago by mserg

You are right, this is the "task" - not "defect". But I can't change parameters of ticket... As an enduser I see the procedures for controlling the cut generators and heuristics in "...Cbc_C_Interface.cpp". Also it's would like to have "Branch and Cut" logic of command "branch" of "cbcSolve.exe" in "...Cbc_C_Interface.cpp". The fatal errors in dll should be fully excluded because the main application is crashed and user can lost the unsaved data. This is my vision...

Thanks,

mserg.

comment:3 Changed 10 years ago by forrest

  • Type changed from defect to task

comment:4 Changed 9 years ago by lou

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

Seems to me that most of this is addressed by CbcMain0, CbcMain1, plus the newly minted ability to create a full cbc DLL. Closing as fixed.

Note: See TracTickets for help on using tickets.