Skip to content

Commit 3b42f70

Browse files
committed
export JuMP models from maximum flow and minimum cost flow problems
1 parent 6d3b623 commit 3b42f70

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
- Optimize allocations in Minimal Spanning Tree.
44
- Export JuMP model from assigment problems.
55
- Export JuMP model from zero-sum games.
6+
- Export JuMP model from Maximum Flow problems.
7+
- Export JuMP model from Minimum Cost Flow problems.
68

79

810

src/maximumflow.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ A structure to hold the result of the maximum flow problem.
3939
4040
- `path::Vector{Connection}`: The connections (edges) in the flow path.
4141
- `flow::Float64`: The total flow through the network.
42+
- `model::JuMP.Model`: The JuMP model used to solve the problem.
4243
4344
"""
4445
struct MaximumFlowResult
4546
path::Vector{Connection}
4647
flow::Float64
48+
model::JuMP.Model
4749
end
4850

4951

@@ -161,7 +163,7 @@ function solve(problem::MaximumFlowProblem)::MaximumFlowResult
161163
end
162164
end
163165

164-
return MaximumFlowResult(solutionnodes, cost)
166+
return MaximumFlowResult(solutionnodes, cost, model)
165167
end
166168

167169

src/minimumcostflow.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ A structure to hold the result of the minimum cost flow problem.
4141
4242
- `path::Vector{Connection}`: The connections (edges) in the flow path.
4343
- `cost::Float64`: The total cost of the flow.
44+
- `model::JuMP.Model`: The JuMP model used to solve the problem.
4445
4546
"""
4647
struct MinimumCostFlowResult
4748
path::Vector{Connection}
4849
cost::Float64
50+
model::JuMP.Model
4951
end
5052

5153

@@ -117,7 +119,7 @@ function solve(problem::MinimumCostFlowProblem, flow::Float64)::MinimumCostFlowR
117119
end
118120
end
119121

120-
return MinimumCostFlowResult(solutionnodes, cost)
122+
return MinimumCostFlowResult(solutionnodes, cost, model)
121123
end
122124

123125

0 commit comments

Comments
 (0)