Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

554
Visualizações
How to perform Integer Linear Programming in Apache Commons Math

The org.apache.commons.math3.optim.linear package in Apache Commons Math Library allows Linear Optimization but the returned values are double. Is there any way to perform Integer Linear Programming using this library? I tried googling but there seems to be no mention of ILP anywhere.

Alternatively, is there any other Java library that can do ILP? please not that I need to run this on android so SCPSolver, GLPK, Or-tools. etc. are not possible.

Thanks in advance.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

As this question and 'Linear Programming in Android' in general is a rarely discussed topic, I figured I would post my findings here for anyone searching in the future.

BTW, I ended up using a port of Ojalgo, given below.

These are the LP Libs that I found can be readily imported into an android project :

Apache Commons Math

Perhaps the most well maintained library, this one supports Linear Optimization but does not have "Integer" LP.

The next two libraries do support Integer LP and/or Mixed Integer LP.

Choco Solver

Even though the Latest version of Choco (4.0) is based on Java 8, there is a Java 7 variant of version 3.3.3 . You can find it here. This imports into Android Studio without any issues.

Another issue you might run into is that even though there are guides and tutorials on their website for version 4, you wont be able to find any guides for Choco 3 except for the Javadocs. But fortunately someone had made a PDF of the older guides which you can get by Googling "Choco3 User Manual".

Also note that Choco is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. So if you want to use LP in a commercial project, consider the next option.

Oj! Algorithms

Ojalgo is another great library which has an MIT Licence and supports Java 7. But as I found out, it uses a couple of Java calls that is not available in Android.

Luckily, an MVP has ported the library to work in Android : KIC/ojAlgoAndroid

This port ran with no issues. I have forked and created a release on Jitpack : shahimclt/ojAlgoAndroid.

over 4 years ago · Santiago Trujillo Relatório

0

Just to fix ShahiM's answer:

  • Choco Solver Licence is BSD-4, so you can use it into a commercial project : https://github.com/chocoteam/choco-solver/blob/master/LICENSE

  • Regarding documentation, well if you want to access the user guide of a previous version, you simply have to look at a previous release, e.g. https://github.com/chocoteam/choco-solver/releases?after=choco-3.3.2

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda