Git Product home page Git Product logo

lp-solvers's People

Contributors

amilajack avatar aphi avatar carrascomj avatar colmanhumphrey avatar dginev avatar dlaehnemann avatar edoriandark avatar fjodorgit avatar jcavat avatar lesstat avatar lovasoa avatar mfuhr avatar remysucre avatar sbeyer avatar tony-cox avatar tvincent2 avatar zappolowski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

lp-solvers's Issues

Implementing MIP gap

I propose implementing a trait with a name like WithMipGap to set the MIP gap for solvers that support it (e.g., --mipgap for GlpkSolver). Any objections? I'd think the gap value should be f64 or f32 so it would be signed -- should the setting method check that the value is >= 0.0 or should it pass the caller's value as-is to the solver?

GurobiSolver not working

Hi,

I was trying to use the Gurobi solver instead of the CBC solver. I have installed Gurobi, got a valid license, and changed the correct environment variable path. I was able to use Gurobi in a program written in Julia. However, when I replaced CbcSolver with GurobiSolver in the example code as below, I got the following error:

fn main() {
    solve_integer_problem_with_solver(GurobiSolver::default())
}

thread 'main' panicked at 'Failed to run solver: "gurobi_cl exited with status exit code: 1"', src/main.rs:197:36
stack backtrace:
0: rust_begin_unwind
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
2: core::option::expect_none_failed
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/option.rs:1329:5
3: core::result::Result<T,E>::expect
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:997:23
4: optimal_representatives::solve_integer_problem_with_solver
at ./src/main.rs:197:20
5: optimal_representatives::main
at ./src/main.rs:203:5
6: core::ops::function::FnOnce::call_once
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
note: Some details are omitted, run with RUST_BACKTRACE=full for a verbose backtrace.

Below are the results I got with RUST_BACKTRACE=full:

thread 'main' panicked at 'Failed to run solver: "gurobi_cl exited with status exit code: 1"', src/main.rs:197:36
stack backtrace:
0: 0x10e1819e4 - std::backtrace_rs::backtrace::libunwind::trace::h0e344f93e1be12b3
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/../../backtrace/src/backtrace/libunwind.rs:90:5
1: 0x10e1819e4 - std::backtrace_rs::backtrace::trace_unsynchronized::h547096f273f197d3
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x10e1819e4 - std::sys_common::backtrace::_print_fmt::h46deca35c22bc084
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:67:5
3: 0x10e1819e4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h80b40bec9b25cdb7
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:46:22
4: 0x10e19e27e - core::fmt::write::h367e10cc391177e1
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/fmt/mod.rs:1092:17
5: 0x10e17f116 - std::io::Write::write_fmt::h69f760cf0ceceb64
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/io/mod.rs:1572:15
6: 0x10e1837a9 - std::sys_common::backtrace::_print::h06c56467d8f0565c
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:49:5
7: 0x10e1837a9 - std::sys_common::backtrace::print::h83e6ec856bd254a6
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:36:9
8: 0x10e1837a9 - std::panicking::default_hook::{{closure}}::h6b461dbc832ae479
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:208:50
9: 0x10e183290 - std::panicking::default_hook::hf6b37b6d4ff1b717
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:225:9
10: 0x10e183f75 - std::panicking::rust_panic_with_hook::hcc0074a2cdf70335
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:591:17
11: 0x10e183a85 - std::panicking::begin_panic_handler::{{closure}}::hafebb92bbb4f046c
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:497:13
12: 0x10e181e48 - std::sys_common::backtrace::__rust_end_short_backtrace::hbd3b6a5769847c0d
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/sys_common/backtrace.rs:141:18
13: 0x10e1839ea - rust_begin_unwind
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:493:5
14: 0x10e19c9bf - core::panicking::panic_fmt::h84e4b5f5d5160f07
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/panicking.rs:92:14
15: 0x10e19c805 - core::option::expect_none_failed::h5c27880b225cac16
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/option.rs:1329:5
16: 0x10e0f31ca - core::result::Result<T,E>::expect::hc4000b462f37413d
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/result.rs:997:23
17: 0x10e100cf1 - optimal_representatives::solve_integer_problem_with_solver::h3ca85bea6a732aba
at /Users/luli/Developer/optimal_reps/src/main.rs:197:20
18: 0x10e100eda - optimal_representatives::main::hd13d3c9adc559796
at /Users/luli/Developer/optimal_reps/src/main.rs:203:5
19: 0x10e0fe42e - core::ops::function::FnOnce::call_once::h38671d614c4aa91e
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/core/src/ops/function.rs:227:5
20: 0x10e0eecb1 - std::sys_common::backtrace::__rust_begin_short_backtrace::ha8759719c946f9a1
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/sys_common/backtrace.rs:125:18
21: 0x10e0f16c4 - std::rt::lang_start::{{closure}}::h1757b4b572bd06f7
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:66:18
22: 0x10e1842e4 - core::ops::function::impls::<impl core::ops::function::FnOnce for &F>::call_once::h3b22ce68aa2879c2
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/core/src/ops/function.rs:259:13
23: 0x10e1842e4 - std::panicking::try::do_call::h51a4853c94b1bdea
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:379:40
24: 0x10e1842e4 - std::panicking::try::ha45bc5eab1f103eb
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panicking.rs:343:19
25: 0x10e1842e4 - std::panic::catch_unwind::h191bc002afc126a7
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/panic.rs:431:14
26: 0x10e1842e4 - std::rt::lang_start_internal::h0c37a46739a0311d
at /rustc/9bc8c42bb2f19e745a63f3445f1ac248fb015e53/library/std/src/rt.rs:51:25
27: 0x10e0f169e - std::rt::lang_start::h8b4b51838af7b438
at /Users/luli/.rustup/toolchains/stable-x86_64-apple-darwin/lib/rustlib/src/rust/library/std/src/rt.rs:65:5
28: 0x10e100ef6 - _main

Thank you so much for your help!

Input linear program using matrix format

Hi,

I'm trying to find some solver to solver some large optimization problems. I have my constraints formatted as Ax=b. However, in the example you provided, variables and constraints are added one by one like below:

variables: vec![
            Variable {
                name: "x".to_string(),
                is_integer: true,
                lower_bound: -10.,
                upper_bound: -1.,
            },
            Variable {
                name: "y".to_string(),
                is_integer: true,
                lower_bound: 4.,
                upper_bound: 7.,
            },
        ],

which does not seem very efficient for problems with thousands of variables. Do you know how to format an optimization problem using sparse matrices and vectors without having to add the coefficients one by one?

Thank you for your help.

Gurobi solver not working due to wrong file format

I tried running the example from the readme with the GurobiSolver::default()-solver and received an the error
Unknown file type for file '/tmp/.tmpaFP4S9'
from the solver.
After testing it with gurobi_cl I figured out that gurobi expects a valid suffix for the ResultFile=-parameter.
So this can be fixed by adding a default solution_suffix-method for the GurobiSolver.

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.