[Python] Combining PULP with HiGHS cmd solver, stuck while writing the solution

Discussão em 'Python' iniciado por Stack, Junho 26, 2025.

  1. Stack

    Stack Membro Participativo

    Combining PULP with HiGHS cmd solver, stuck while writing the solution

    I have developed MIP built with PuLP in python, using the HiGHS cmd Solver. I originally developed the entire code in Mac where it runs smoothly within seconds. Now when I am trying to run the same script in a Windows system, the solver is getting stuck at final step. Following is the code snippet I am using for LP:

    prob = pl.LpProblem("Arrangement Pl", pl.LpMaximize)
    cutVariables = pl.LpVariable.dict("cuts", cuts, 0, None, pl.LpInteger)

    prob += pl.lpSum([WidthOrder * cutVariables for i in cuts])
    prob += pl.lpSum([WidthOrder * cutVariables for i in cuts]) <= Deckle
    prob += pl.lpSum([cutVariables for i in cuts]) <= maxCuts
    for i in cuts:
    prob += cutVariables <= OrderDict

    solver = pl.HiGHS_CMD(path=path_to_HiGHS)
    result = prob.solve(solver)


    The script is stuck at prob.solve() line. Following is the output message, I get before the script stucks forever

    Running HiGHS 1.5.3 [date: 1970-01-01, git hash: 45a127b78]
    Copyright (c) 2023 HiGHS under MIT licence terms
    MIP Arrangement_Pl-pulp has 3 rows; 1 cols; 3 nonzeros; 1 integer variables
    Presolving model
    0 rows, 0 cols, 0 nonzeros
    0 rows, 0 cols, 0 nonzeros
    Presolve: Optimal

    Solving report
    Status Optimal
    Primal bound 400
    Dual bound 400
    Gap 0% (tolerance: 0.01%)
    Solution status feasible
    400 (objective)
    0 (bound viol.)
    0 (int. viol.)
    0 (row viol.)
    Timing 0.01 (total)
    0.01 (presolve)
    0.00 (postsolve)
    Nodes 0
    LP iterations 0 (total)
    0 (strong br.)
    0 (separation)
    0 (heuristics)
    Writing the solution to Arrangement_Pl-pulp.sol


    I am fairly new to this and any suggestion is appreciated.

    Continue reading...

Compartilhe esta Página