Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jun 24, 2025

This PR adds complete support for the HiGHS optimization solver to RAMS, allowing users to leverage this high-performance linear and mixed-integer programming solver.

Changes Made

Core Implementation

  • New solver class: Added lib/rams/solvers/highs.rb implementing the HiGHS interface following the existing RAMS solver pattern
  • Model integration: Updated lib/rams/model.rb to include HiGHS in the available solvers list
  • Output parsing: Implemented proper parsing of HiGHS solution format including:
    • Solution status (optimal, feasible, infeasible, unbounded)
    • Objective values
    • Primal variable values
    • Dual constraint values

Testing & Documentation

  • Test coverage: Added comprehensive tests for HiGHS solver path customization in tests/test_solver_paths.rb
  • Documentation: Updated docs/03-solver-configuration.md with HiGHS examples and configuration options
  • Environment variables: Added support for RAMS_SOLVER_PATH_HIGHS to customize HiGHS executable path

Usage

Users can now use HiGHS by setting the solver:

m = RAMS::Model.new
# ... define variables and constraints ...
m.solver = :highs
m.solve  # Uses HiGHS solver

Custom Arguments

HiGHS-specific arguments can be passed through:

m.solver = :highs
m.args = ['--time_limit', '10', '--solver', 'simplex']
m.solve

Custom Installation Path

For non-standard HiGHS installations:

export RAMS_SOLVER_PATH_HIGHS=/opt/highs/bin/highs

Compatibility

  • Supports both continuous and integer/binary optimization problems
  • Maintains full compatibility with existing RAMS functionality
  • All existing tests continue to pass
  • Follows the same interface pattern as other RAMS solvers (CBC, CLP, CPLEX, GLPK, SCIP)

Fixes #33.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 2 commits June 24, 2025 03:40
Co-authored-by: ryanjoneil <6748953+ryanjoneil@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for the HiGHS optimization solver Add support for the HiGHS optimization solver Jun 24, 2025
Copilot AI requested a review from ryanjoneil June 24, 2025 03:42
Copy link
Owner

@ryanjoneil ryanjoneil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good. Let's make sure it works in GitHub Actions.

  • Add coin-or-HiGHS to the list of packages to install via dnf.
  • Create and set an environment variable for running HiGHS tests in the workflow (RAMS_TEST_HIGHS: true).
  • Add HiGHS to the tests in test/test_model.rb.

Co-authored-by: ryanjoneil <6748953+ryanjoneil@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jun 24, 2025

Code looks good. Let's make sure it works in GitHub Actions.

  • Add coin-or-HiGHS to the list of packages to install via dnf.
    ...

All requested changes implemented in commit bfe6668:

  1. Added coin-or-HiGHS to dnf package installation in GitHub Actions workflow
  2. Added RAMS_TEST_HIGHS: true environment variable to enable HiGHS testing
  3. Added HiGHS solver tests to all test methods in tests/test_model.rb (simple, binary, integer, infeasible, unbounded, and implication tests)

HiGHS should now work properly in GitHub Actions CI/CD pipeline.

Copilot AI requested a review from ryanjoneil June 24, 2025 03:53
@ryanjoneil ryanjoneil marked this pull request as ready for review June 24, 2025 03:56
@ryanjoneil
Copy link
Owner

Removes CPLEX since we can't test it and want to focus on OSS solvers.

@ryanjoneil ryanjoneil merged commit edc2e30 into main Jun 24, 2025
1 check passed
@ryanjoneil ryanjoneil deleted the copilot/fix-33 branch June 24, 2025 16:07
Copilot AI requested a review from ryanjoneil June 24, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for the HiGHS optimization solver

2 participants