PyOR 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
pyor-1.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 PyOR Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
pyor-1.0.0/MANIFEST.in ADDED
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ include pyproject.toml
4
+ recursive-include pyOR *.py
5
+ recursive-include tests *.py
pyor-1.0.0/PKG-INFO ADDED
@@ -0,0 +1,313 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyOR
3
+ Version: 1.0.0
4
+ Summary: Python Operations Research — LP, Simplex, Transportation, Assignment, PERT/CPM, Curve Fitting & more
5
+ Author: PyOR Contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 PyOR Contributors
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/PyOR-dev/PyOR
29
+ Project-URL: Documentation, https://github.com/PyOR-dev/PyOR#readme
30
+ Project-URL: Issues, https://github.com/PyOR-dev/PyOR/issues
31
+ Keywords: operations research,linear programming,simplex,transportation,assignment,PERT,CPM,curve fitting,spline,optimization
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: Intended Audience :: Education
35
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.8
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Requires-Python: >=3.8
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: numpy>=1.21
47
+ Requires-Dist: scipy>=1.7
48
+ Provides-Extra: plot
49
+ Requires-Dist: matplotlib>=3.4; extra == "plot"
50
+ Provides-Extra: dev
51
+ Requires-Dist: pytest>=7; extra == "dev"
52
+ Requires-Dist: pytest-cov; extra == "dev"
53
+ Requires-Dist: matplotlib>=3.4; extra == "dev"
54
+ Requires-Dist: twine; extra == "dev"
55
+ Requires-Dist: build; extra == "dev"
56
+ Dynamic: license-file
57
+ Dynamic: requires-python
58
+
59
+ # PyOR — Python Operations Research Library
60
+
61
+ [![PyPI version](https://img.shields.io/pypi/v/PyOR.svg)](https://pypi.org/project/PyOR/)
62
+ [![Python](https://img.shields.io/pypi/pyversions/PyOR.svg)](https://pypi.org/project/PyOR/)
63
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
64
+
65
+ **PyOR** is a comprehensive, educational Operations Research library for Python.
66
+ It covers all major OR methods with clear docstrings, step-by-step output, and optional plots.
67
+
68
+ ---
69
+
70
+ ## 📦 Installation
71
+
72
+ ```bash
73
+ pip install PyOR
74
+ # With plotting support
75
+ pip install PyOR[plot]
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 🗂️ Modules & Methods
81
+
82
+ | # | Method | Class / Function |
83
+ |---|--------|-----------------|
84
+ | 1 | Linear Programming Formulation | `LinearProgram` |
85
+ | 2 | Graphical Method | `GraphicalMethod` |
86
+ | 3 | Simplex Method | `SimplexMethod` |
87
+ | 4 | Dual Simplex Method | `DualSimplex` |
88
+ | 5 | Big-M Method | `BigMMethod` |
89
+ | 6 | Transportation — North-West Corner | `north_west_corner()` |
90
+ | 7 | Transportation — Least Cost | `least_cost_method()` |
91
+ | 8 | Transportation — Vogel's Approximation | `vogel_approximation()` |
92
+ | 9 | Transportation — MODI (Optimality) | `modi_method()` |
93
+ | 10 | Assignment Problem | `AssignmentProblem` |
94
+ | 11 | Project Management (PERT / CPM) | `PERTCPMNetwork` |
95
+ | 12 | Curve Fitting — Least Squares | `CurveFitter` |
96
+ | 13 | Cubic Spline Interpolation | `CubicSplineFitter` |
97
+
98
+ ---
99
+
100
+ ## 🚀 Quick Examples
101
+
102
+ ### 1. Linear Programming
103
+
104
+ ```python
105
+ from pyOR import LinearProgram
106
+
107
+ lp = LinearProgram(
108
+ c = [-3, -5], # maximise 3x₁ + 5x₂
109
+ A_ub = [[1,0],[0,2],[3,2]],
110
+ b_ub = [4, 12, 18],
111
+ objective = 'max'
112
+ )
113
+ result = lp.solve()
114
+ lp.display()
115
+ # → x1=2, x2=6, Z*=36
116
+ ```
117
+
118
+ ### 2. Graphical Method
119
+
120
+ ```python
121
+ from pyOR import GraphicalMethod
122
+
123
+ gm = GraphicalMethod(
124
+ c = [3, 5],
125
+ constraints = [(1, 0, '<=', 4),
126
+ (0, 2, '<=', 12),
127
+ (3, 2, '<=', 18)],
128
+ objective = 'max'
129
+ )
130
+ result = gm.solve()
131
+ gm.display()
132
+ gm.plot() # requires matplotlib
133
+ ```
134
+
135
+ ### 3. Simplex Method
136
+
137
+ ```python
138
+ from pyOR import SimplexMethod
139
+
140
+ sm = SimplexMethod(
141
+ c = [5, 4, 3],
142
+ A = [[6,4,2],[3,2,5],[5,6,5]],
143
+ b = [240, 270, 420],
144
+ objective = 'max'
145
+ )
146
+ result = sm.solve()
147
+ sm.display(show_tableaux=True)
148
+ ```
149
+
150
+ ### 4. Dual Simplex Method
151
+
152
+ ```python
153
+ from pyOR import DualSimplex
154
+
155
+ ds = DualSimplex(
156
+ c = [2, 3],
157
+ A = [[1,1],[1,0],[0,1]],
158
+ b = [4, 2, 3],
159
+ senses = ['<=','<=','<='],
160
+ objective= 'min'
161
+ )
162
+ ds.solve()
163
+ ds.display()
164
+ ```
165
+
166
+ ### 5. Big-M Method
167
+
168
+ ```python
169
+ from pyOR import BigMMethod
170
+
171
+ bm = BigMMethod(
172
+ c = [2, 3],
173
+ A = [[1,1],[1,0],[0,1]],
174
+ b = [4, 2, 3],
175
+ senses = ['<=','>=','>='],
176
+ objective= 'min'
177
+ )
178
+ bm.solve()
179
+ bm.display()
180
+ ```
181
+
182
+ ### 6–9. Transportation Problem
183
+
184
+ ```python
185
+ from pyOR import north_west_corner, least_cost_method, vogel_approximation, modi_method
186
+
187
+ cost = [[2, 3, 1], [5, 4, 8], [5, 6, 8]]
188
+ supply = [120, 80, 80]
189
+ demand = [150, 70, 60]
190
+
191
+ # Initial BFS methods
192
+ north_west_corner(cost, supply, demand)
193
+ least_cost_method(cost, supply, demand)
194
+ vogel_approximation(cost, supply, demand)
195
+
196
+ # Optimal solution using MODI
197
+ result = modi_method(cost, supply, demand, initial_method='vam')
198
+ print("Optimal Cost:", result['total_cost'])
199
+ ```
200
+
201
+ ### 10. Assignment Problem
202
+
203
+ ```python
204
+ from pyOR import AssignmentProblem
205
+
206
+ ap = AssignmentProblem(
207
+ cost_matrix = [[9,2,7,8],
208
+ [6,4,3,7],
209
+ [5,8,1,8],
210
+ [7,6,9,4]],
211
+ objective = 'min',
212
+ row_names = ['Worker A','Worker B','Worker C','Worker D'],
213
+ col_names = ['Job 1','Job 2','Job 3','Job 4']
214
+ )
215
+ ap.solve()
216
+ ap.display()
217
+ ```
218
+
219
+ ### 11. PERT / CPM
220
+
221
+ ```python
222
+ from pyOR import PERTCPMNetwork
223
+
224
+ # CPM
225
+ activities = [
226
+ {'name':'A','depends':[], 'duration':4},
227
+ {'name':'B','depends':[], 'duration':5},
228
+ {'name':'C','depends':['A'], 'duration':3},
229
+ {'name':'D','depends':['B'], 'duration':4},
230
+ {'name':'E','depends':['C','D'],'duration':6},
231
+ ]
232
+ net = PERTCPMNetwork(activities)
233
+ net.solve()
234
+ net.display()
235
+
236
+ # PERT with probability
237
+ activities_pert = [
238
+ {'name':'A','depends':[],'optimistic':2,'most_likely':4,'pessimistic':6},
239
+ {'name':'B','depends':['A'],'optimistic':3,'most_likely':5,'pessimistic':9},
240
+ ]
241
+ net2 = PERTCPMNetwork(activities_pert)
242
+ net2.solve()
243
+ net2.display(show_probability=15)
244
+ print(net2.completion_probability(15))
245
+ ```
246
+
247
+ ### 12. Curve Fitting
248
+
249
+ ```python
250
+ from pyOR import CurveFitter
251
+
252
+ cf = CurveFitter(x=[1,2,3,4,5], y=[2.1,3.9,6.1,8.1,10.1])
253
+
254
+ # Linear
255
+ cf.fit('linear')
256
+ cf.display()
257
+ cf.plot()
258
+
259
+ # Polynomial degree 2
260
+ cf.fit('polynomial', degree=2)
261
+ cf.display()
262
+
263
+ # Exponential, Power, Logarithmic, Reciprocal
264
+ for model in ['exponential', 'power', 'logarithmic', 'reciprocal']:
265
+ cf.fit(model)
266
+ print(f"{model}: R² = {cf.result['r_squared']:.4f}")
267
+ ```
268
+
269
+ ### 13. Cubic Spline
270
+
271
+ ```python
272
+ from pyOR import CubicSplineFitter
273
+
274
+ sf = CubicSplineFitter(
275
+ x=[0, 1, 2, 3, 4],
276
+ y=[0, 1, 0, 1, 0],
277
+ bc_type='natural'
278
+ )
279
+ sf.fit()
280
+ sf.display()
281
+
282
+ # Evaluate at a point
283
+ y_val = sf.evaluate(1.5)
284
+ dy = sf.derivative(1.5, order=1)
285
+ print(f"S(1.5) = {y_val}, S'(1.5) = {dy}")
286
+
287
+ sf.plot()
288
+ ```
289
+
290
+ ---
291
+
292
+ ## 📐 Dependencies
293
+
294
+ | Package | Version |
295
+ |---------|---------|
296
+ | numpy | ≥ 1.21 |
297
+ | scipy | ≥ 1.7 |
298
+ | matplotlib | ≥ 3.4 (optional, for plots) |
299
+
300
+ ---
301
+
302
+ ## 🧪 Running Tests
303
+
304
+ ```bash
305
+ pip install PyOR[dev]
306
+ pytest tests/ -v
307
+ ```
308
+
309
+ ---
310
+
311
+ ## 📜 License
312
+
313
+ MIT © 2025 PyOR Contributors
@@ -0,0 +1,313 @@
1
+ Metadata-Version: 2.4
2
+ Name: PyOR
3
+ Version: 1.0.0
4
+ Summary: Python Operations Research — LP, Simplex, Transportation, Assignment, PERT/CPM, Curve Fitting & more
5
+ Author: PyOR Contributors
6
+ License: MIT License
7
+
8
+ Copyright (c) 2025 PyOR Contributors
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/PyOR-dev/PyOR
29
+ Project-URL: Documentation, https://github.com/PyOR-dev/PyOR#readme
30
+ Project-URL: Issues, https://github.com/PyOR-dev/PyOR/issues
31
+ Keywords: operations research,linear programming,simplex,transportation,assignment,PERT,CPM,curve fitting,spline,optimization
32
+ Classifier: Development Status :: 4 - Beta
33
+ Classifier: Intended Audience :: Science/Research
34
+ Classifier: Intended Audience :: Education
35
+ Classifier: Topic :: Scientific/Engineering :: Mathematics
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Programming Language :: Python :: 3
38
+ Classifier: Programming Language :: Python :: 3.8
39
+ Classifier: Programming Language :: Python :: 3.9
40
+ Classifier: Programming Language :: Python :: 3.10
41
+ Classifier: Programming Language :: Python :: 3.11
42
+ Classifier: Programming Language :: Python :: 3.12
43
+ Requires-Python: >=3.8
44
+ Description-Content-Type: text/markdown
45
+ License-File: LICENSE
46
+ Requires-Dist: numpy>=1.21
47
+ Requires-Dist: scipy>=1.7
48
+ Provides-Extra: plot
49
+ Requires-Dist: matplotlib>=3.4; extra == "plot"
50
+ Provides-Extra: dev
51
+ Requires-Dist: pytest>=7; extra == "dev"
52
+ Requires-Dist: pytest-cov; extra == "dev"
53
+ Requires-Dist: matplotlib>=3.4; extra == "dev"
54
+ Requires-Dist: twine; extra == "dev"
55
+ Requires-Dist: build; extra == "dev"
56
+ Dynamic: license-file
57
+ Dynamic: requires-python
58
+
59
+ # PyOR — Python Operations Research Library
60
+
61
+ [![PyPI version](https://img.shields.io/pypi/v/PyOR.svg)](https://pypi.org/project/PyOR/)
62
+ [![Python](https://img.shields.io/pypi/pyversions/PyOR.svg)](https://pypi.org/project/PyOR/)
63
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
64
+
65
+ **PyOR** is a comprehensive, educational Operations Research library for Python.
66
+ It covers all major OR methods with clear docstrings, step-by-step output, and optional plots.
67
+
68
+ ---
69
+
70
+ ## 📦 Installation
71
+
72
+ ```bash
73
+ pip install PyOR
74
+ # With plotting support
75
+ pip install PyOR[plot]
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 🗂️ Modules & Methods
81
+
82
+ | # | Method | Class / Function |
83
+ |---|--------|-----------------|
84
+ | 1 | Linear Programming Formulation | `LinearProgram` |
85
+ | 2 | Graphical Method | `GraphicalMethod` |
86
+ | 3 | Simplex Method | `SimplexMethod` |
87
+ | 4 | Dual Simplex Method | `DualSimplex` |
88
+ | 5 | Big-M Method | `BigMMethod` |
89
+ | 6 | Transportation — North-West Corner | `north_west_corner()` |
90
+ | 7 | Transportation — Least Cost | `least_cost_method()` |
91
+ | 8 | Transportation — Vogel's Approximation | `vogel_approximation()` |
92
+ | 9 | Transportation — MODI (Optimality) | `modi_method()` |
93
+ | 10 | Assignment Problem | `AssignmentProblem` |
94
+ | 11 | Project Management (PERT / CPM) | `PERTCPMNetwork` |
95
+ | 12 | Curve Fitting — Least Squares | `CurveFitter` |
96
+ | 13 | Cubic Spline Interpolation | `CubicSplineFitter` |
97
+
98
+ ---
99
+
100
+ ## 🚀 Quick Examples
101
+
102
+ ### 1. Linear Programming
103
+
104
+ ```python
105
+ from pyOR import LinearProgram
106
+
107
+ lp = LinearProgram(
108
+ c = [-3, -5], # maximise 3x₁ + 5x₂
109
+ A_ub = [[1,0],[0,2],[3,2]],
110
+ b_ub = [4, 12, 18],
111
+ objective = 'max'
112
+ )
113
+ result = lp.solve()
114
+ lp.display()
115
+ # → x1=2, x2=6, Z*=36
116
+ ```
117
+
118
+ ### 2. Graphical Method
119
+
120
+ ```python
121
+ from pyOR import GraphicalMethod
122
+
123
+ gm = GraphicalMethod(
124
+ c = [3, 5],
125
+ constraints = [(1, 0, '<=', 4),
126
+ (0, 2, '<=', 12),
127
+ (3, 2, '<=', 18)],
128
+ objective = 'max'
129
+ )
130
+ result = gm.solve()
131
+ gm.display()
132
+ gm.plot() # requires matplotlib
133
+ ```
134
+
135
+ ### 3. Simplex Method
136
+
137
+ ```python
138
+ from pyOR import SimplexMethod
139
+
140
+ sm = SimplexMethod(
141
+ c = [5, 4, 3],
142
+ A = [[6,4,2],[3,2,5],[5,6,5]],
143
+ b = [240, 270, 420],
144
+ objective = 'max'
145
+ )
146
+ result = sm.solve()
147
+ sm.display(show_tableaux=True)
148
+ ```
149
+
150
+ ### 4. Dual Simplex Method
151
+
152
+ ```python
153
+ from pyOR import DualSimplex
154
+
155
+ ds = DualSimplex(
156
+ c = [2, 3],
157
+ A = [[1,1],[1,0],[0,1]],
158
+ b = [4, 2, 3],
159
+ senses = ['<=','<=','<='],
160
+ objective= 'min'
161
+ )
162
+ ds.solve()
163
+ ds.display()
164
+ ```
165
+
166
+ ### 5. Big-M Method
167
+
168
+ ```python
169
+ from pyOR import BigMMethod
170
+
171
+ bm = BigMMethod(
172
+ c = [2, 3],
173
+ A = [[1,1],[1,0],[0,1]],
174
+ b = [4, 2, 3],
175
+ senses = ['<=','>=','>='],
176
+ objective= 'min'
177
+ )
178
+ bm.solve()
179
+ bm.display()
180
+ ```
181
+
182
+ ### 6–9. Transportation Problem
183
+
184
+ ```python
185
+ from pyOR import north_west_corner, least_cost_method, vogel_approximation, modi_method
186
+
187
+ cost = [[2, 3, 1], [5, 4, 8], [5, 6, 8]]
188
+ supply = [120, 80, 80]
189
+ demand = [150, 70, 60]
190
+
191
+ # Initial BFS methods
192
+ north_west_corner(cost, supply, demand)
193
+ least_cost_method(cost, supply, demand)
194
+ vogel_approximation(cost, supply, demand)
195
+
196
+ # Optimal solution using MODI
197
+ result = modi_method(cost, supply, demand, initial_method='vam')
198
+ print("Optimal Cost:", result['total_cost'])
199
+ ```
200
+
201
+ ### 10. Assignment Problem
202
+
203
+ ```python
204
+ from pyOR import AssignmentProblem
205
+
206
+ ap = AssignmentProblem(
207
+ cost_matrix = [[9,2,7,8],
208
+ [6,4,3,7],
209
+ [5,8,1,8],
210
+ [7,6,9,4]],
211
+ objective = 'min',
212
+ row_names = ['Worker A','Worker B','Worker C','Worker D'],
213
+ col_names = ['Job 1','Job 2','Job 3','Job 4']
214
+ )
215
+ ap.solve()
216
+ ap.display()
217
+ ```
218
+
219
+ ### 11. PERT / CPM
220
+
221
+ ```python
222
+ from pyOR import PERTCPMNetwork
223
+
224
+ # CPM
225
+ activities = [
226
+ {'name':'A','depends':[], 'duration':4},
227
+ {'name':'B','depends':[], 'duration':5},
228
+ {'name':'C','depends':['A'], 'duration':3},
229
+ {'name':'D','depends':['B'], 'duration':4},
230
+ {'name':'E','depends':['C','D'],'duration':6},
231
+ ]
232
+ net = PERTCPMNetwork(activities)
233
+ net.solve()
234
+ net.display()
235
+
236
+ # PERT with probability
237
+ activities_pert = [
238
+ {'name':'A','depends':[],'optimistic':2,'most_likely':4,'pessimistic':6},
239
+ {'name':'B','depends':['A'],'optimistic':3,'most_likely':5,'pessimistic':9},
240
+ ]
241
+ net2 = PERTCPMNetwork(activities_pert)
242
+ net2.solve()
243
+ net2.display(show_probability=15)
244
+ print(net2.completion_probability(15))
245
+ ```
246
+
247
+ ### 12. Curve Fitting
248
+
249
+ ```python
250
+ from pyOR import CurveFitter
251
+
252
+ cf = CurveFitter(x=[1,2,3,4,5], y=[2.1,3.9,6.1,8.1,10.1])
253
+
254
+ # Linear
255
+ cf.fit('linear')
256
+ cf.display()
257
+ cf.plot()
258
+
259
+ # Polynomial degree 2
260
+ cf.fit('polynomial', degree=2)
261
+ cf.display()
262
+
263
+ # Exponential, Power, Logarithmic, Reciprocal
264
+ for model in ['exponential', 'power', 'logarithmic', 'reciprocal']:
265
+ cf.fit(model)
266
+ print(f"{model}: R² = {cf.result['r_squared']:.4f}")
267
+ ```
268
+
269
+ ### 13. Cubic Spline
270
+
271
+ ```python
272
+ from pyOR import CubicSplineFitter
273
+
274
+ sf = CubicSplineFitter(
275
+ x=[0, 1, 2, 3, 4],
276
+ y=[0, 1, 0, 1, 0],
277
+ bc_type='natural'
278
+ )
279
+ sf.fit()
280
+ sf.display()
281
+
282
+ # Evaluate at a point
283
+ y_val = sf.evaluate(1.5)
284
+ dy = sf.derivative(1.5, order=1)
285
+ print(f"S(1.5) = {y_val}, S'(1.5) = {dy}")
286
+
287
+ sf.plot()
288
+ ```
289
+
290
+ ---
291
+
292
+ ## 📐 Dependencies
293
+
294
+ | Package | Version |
295
+ |---------|---------|
296
+ | numpy | ≥ 1.21 |
297
+ | scipy | ≥ 1.7 |
298
+ | matplotlib | ≥ 3.4 (optional, for plots) |
299
+
300
+ ---
301
+
302
+ ## 🧪 Running Tests
303
+
304
+ ```bash
305
+ pip install PyOR[dev]
306
+ pytest tests/ -v
307
+ ```
308
+
309
+ ---
310
+
311
+ ## 📜 License
312
+
313
+ MIT © 2025 PyOR Contributors
@@ -0,0 +1,21 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ setup.py
6
+ PyOR.egg-info/PKG-INFO
7
+ PyOR.egg-info/SOURCES.txt
8
+ PyOR.egg-info/dependency_links.txt
9
+ PyOR.egg-info/requires.txt
10
+ PyOR.egg-info/top_level.txt
11
+ pyOR/__init__.py
12
+ pyOR/assignment.py
13
+ pyOR/big_m.py
14
+ pyOR/curve_fitting.py
15
+ pyOR/dual_simplex.py
16
+ pyOR/graphical_method.py
17
+ pyOR/linear_programming.py
18
+ pyOR/project_management.py
19
+ pyOR/simplex.py
20
+ pyOR/spline_fitting.py
21
+ pyOR/transportation.py
@@ -0,0 +1,12 @@
1
+ numpy>=1.21
2
+ scipy>=1.7
3
+
4
+ [dev]
5
+ pytest>=7
6
+ pytest-cov
7
+ matplotlib>=3.4
8
+ twine
9
+ build
10
+
11
+ [plot]
12
+ matplotlib>=3.4
@@ -0,0 +1 @@
1
+ pyOR