[Python] How to configure PuLP to call GLPK solver

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am using the PuLP library in Python to solve an MILP problem. I have run my problem successfully with the default solver (CBC). Now I would like to use PuLP with another solver (GLPK). How do I set up PuLP with GLPK?

    I have done some research online and found information on how to use GLPK (e.g. with lp_prob.solve(pulp.GLPK_CMD())) but haven't found information on how to actually set up PuLP with GLPK (or any other solver for that matter), so that it finds my GLPK installation. I have already installed GLPK seperately (but I didn't add it to my PATH environment variable).

    I ran the command pulp.pulpTestAll()

    and got:

    Solver <class 'pulp.solvers.GLPK_CMD'> unavailable

    I know that I should be getting a "passed" instead of an "unavailable" to be able to use it.

    Continue reading...

Compartilhe esta Página