Skip to content

Commit a434933

Browse files
committed
export JuMP model from Shortest Path problems
1 parent 3b42f70 commit a434933

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/pmedian.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ using JuMP, HiGHS
1515
- `objective::Float64`: Objective value.
1616
- `z::Matrix`: Binary matrix of assignments. If z[i, j] = 1 then ith point is connected to the jth point.
1717
- `y::Vector`: Binary vector. If y[i] is 1 then ith point is a depot.
18+
1819
"""
1920
struct PMedianResult
2021
centers::Vector

src/shortestpath.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 shortest path problem.
3939
4040
- `path::Vector{Connection}`: The connections (edges) in the shortest path.
4141
- `cost::Float64`: The total cost of the shortest path.
42+
- `model::JuMP.Model`: The JuMP model used to solve the problem.
4243
4344
"""
4445
struct ShortestPathResult
4546
path::Vector{Connection}
4647
cost::Float64
48+
model::JuMP.Model
4749
end
4850

4951

@@ -182,7 +184,7 @@ function solve(problem::ShortestPathProblem)
182184
end
183185
end
184186

185-
return ShortestPathResult(solutionnodes, cost)
187+
return ShortestPathResult(solutionnodes, cost, model)
186188
end
187189

188190

0 commit comments

Comments
 (0)