Code Monkey home page Code Monkey logo

Comments (2)

sschnug avatar sschnug commented on July 20, 2024 2

Afaik there is no algebraic modelling (or let's say matrix-based modelling) available in SCIP, meaning: there is no way to define a vector / batch of variables and there is no way to define a vector / batch of constraints defined by a constraint coeff-matrix and a constraint rhs-vector.
Each var and each constraint introduced needs an explicit call to do that.

That being said, i don't see the issue.

Targeting this kind of low-lvl algebraic structure (i'm having Highs in mind which i once filled with some parent which also filled or-tools' PDLP) sounds relatively straightforward to me:

  • One loop over your coeff-matrix columns for introducing variables
  • One loop over your coeff-matrix rows for introducing linear-constraints (SCIP actually also provides range-constraints out of the box)

I would guess that's < 100 lines of code. Maybe even < 50 if one would store the algebraic model in something like Eigen. Don't forget the necessary memory-management (SCIPfree...)

Don't you agree, that a 50-100 loc wrapper external_to_scip(...) is a small investment?

One more remark:

  • There might also be a way to just write out lp/mps in one of your other tools and read that into SCIP (even through streams/pipes if "real" files make you nervous)

One more opinion:

  • I think the most interesting part of SCIP (where it even surpasses all commercial solvers and other alternatives) is it's plugin system and what you can do with it:
    • One might argue, that the information-loss you experienced by importing the low-lvl model instead of the high-lvl model is problematic
      • It's not uncommon in my code, that SCIP types are embedded into some high-lvl C++ types like EigenMatrix or boost::graph which (depending on your problem) allows lots of powerful things!

from scip.

ambros-gleixner avatar ambros-gleixner commented on July 20, 2024

Hi, you are correct that there is no such matrix-based problem creation function in SCIP. I agree that this would be a nice convenience feature. It could be an addition to the interface of cons_linear. I don't think we are going to implement that ourselves, but we would welcome and support a PR! (The solution is pretty much a combination of for loops as described by @sschnug .)

from scip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.