問題タブ [pulp]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - testing pulp installation fails
Following instructions from http://www.coin-or.org/PuLP/main/installing_pulp_at_home.html#installation , I installed PuLP using "Windows Installation from source"
When I tried to run the test on the page ( Instructions on the page : "To test that that you pulp installation is working correctly please type the following into a python interpreter and note that the output should be similar. The output below is what you would expect if you have not installed any other solvers and the CoinMP solver bundled with pulp works.")
My Results :
import pulp pulp.pulpTestAll() Solver pulp.solvers.CPLEX_DLL unavailable. Solver pulp.solvers.CPLEX_CMD unavailable. Solver pulp.solvers.COIN_CMD unavailable. Solver pulp.solvers.COINMP_DLL unavailable. Solver pulp.solvers.GLPK_CMD unavailable. Solver pulp.solvers.XPRESS unavailable. Solver pulp.solvers.GUROBI unavailable.
According to the webpage,this should be my output :
import pulp pulp.pulpTestAll()
Solver pulp.pulp.COIN_MEM unavailable. Solver pulp.pulp.COIN_CMD unavailable. Testing continuous LP solution Testing maximize continuous LP solution Testing unbounded continuous LP solution Testing MIP solution Testing MIP relaxation Testing feasibility problem (no objective) Testing an infeasible problem Testing an integer infeasible problem (Error to be fixed) Testing column based modelling Testing column based modelling with empty constraints Testing dual variables and slacks reporting Testing resolve of problem Testing Sequential Solves Testing fractional constraints Testing elastic constraints (no change) Testing elastic constraints (freebound) Testing elastic constraints (penalty unchanged) Testing elastic constraints (penalty unbounded) * Solver pulp.pulp.COINMP_DLL passed. Solver pulp.pulp.GLPK_MEM unavailable. Solver pulp.pulp.GLPK_CMD unavailable. Solver pulp.pulp.XPRESS unavailable.
I am using Python 2.7.1, PuLP 1.4.7 on Windows 7 64 bit.
I guess it is because the CoinMP solver bundled with PuLP is not working. I just started working on Python a week back, I am just an amateur in programming.
python - 行列で使用する Python Pulp
何年も何年もMatlabを使用した後、私はまだPythonに非常に慣れていません。Pulp を使用して整数線形プログラムをセットアップしようとしています。
数値の配列が与えられた場合:
私は最大化したい:
制約を受ける
および境界あり (ベクトルベースの境界)
しかし、パルプでは、ベクトル宣言を適切に行う方法がわかりません。私が使用していた:
ここでは、個々の境界のみを入力できます (したがって、1 つの数値のみ)。
制約については、本当にこの行を行ごとに実行する必要がありますか? 何かが足りないようです。助けていただければ幸いです。ドキュメントでは、短い例について説明しています。私の場合、変数の数は数千です。
python - ユーザーが変数を入力できるようにする (Python)
私は PuLP を使用してプロジェクトに取り組んでおり、ユーザーがデータを入力できるようにするターミナル プロンプトを作成しようとしています。その後、私の Python プログラムは入力を PuLP で読み取り可能なコードに変更します。これを行うには、ユーザーに次の入力を許可する必要があります。
私のコードはこのコードをeval()し、変数a、b、cを作成します
何か案は?exec() を使用してみましたが、あまり気に入らないようです。
現時点では、次の方法で入力を取得しています。
したがって、文字列 2*a+3*B <= c は entryS として格納されます
python - パルプの問題 (python)
パルプに問題があります。この制約を変換しようとしています
しかし、それが公平かどうかはわかりません。エラーはありませんが、目的関数は0です
python - 反復的な Python PuLP 構文を簡素化するには?
次の Python PuLP ステートメントを、より Pythonic で管理しやすく正しいものに単純化するにはどうすればよいですか。
python - PuLP のナップサック、選択したアイテム数に制約を追加
ナップザックの問題を解決する puLP コードがいくつかあります。
しかし、このコードには別の制限を追加する必要があります。たとえば、ゼロ以外の数はprob.variables
(たとえば) 10 に等しいという制限です。
誰でもそれを手伝ってもらえますか?
アップデート:
このコードの出力は次のとおりです。
ゼロ以外の値prob.variables
を持つのは 4 つだけです。しかし、10 個必要だとしたら、どうすればそれを保証できるでしょうか?
python - PuLP から Scipy への移行
私は PuLP を使用して、制約、上限および下限を使用していくつかの最小化問題を解決しています。とても簡単できれいです。
ただし、Scipy および Numpy モジュールのみを使用する必要があります。
私が読んでいた: http://docs.scipy.org/doc/scipy/reference/tutorial/optimize.html
多変量スカラー関数の制約付き最小化
しかし、私は少し迷っています...いくつかの良い魂は、このPuLPのような小さな例をScipyに投稿できますか?
前もって感謝します。んん