Skip to content

Commit 68773ad

Browse files
committed
add documentation for initial feasible solution methods for the transportation problem
1 parent 4129b21 commit 68773ad

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

docs/src/algorithms.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,26 @@ OperationsResearchModels.solve(a::AssignmentProblem)
66
```
77

88
## Transportation Problem
9+
910
```@docs
1011
OperationsResearchModels.solve(t::TransportationProblem)
1112
```
1213

14+
### Initial basic solutions for a transportation problem
15+
16+
#### North-west Corner Method
17+
18+
```@docs
19+
OperationsResearchModels.northwestcorner
20+
```
21+
22+
#### The Least Cost Method
23+
24+
```@docs
25+
OperationsResearchModels.leastcost
26+
```
27+
28+
1329
## Shortest Path
1430
```@docs
1531
OperationsResearchModels.solve(t::ShortestPathProblem)

src/transportation.jl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ function solve(t::TransportationProblem)::TransportationResult
167167
return result
168168
end
169169

170+
"""
171+
northwestcorner(a::TransportationProblem)::TransportationResult
172+
173+
# Description
174+
175+
The northwest corner method is a heuristic for finding an initial basic feasible solution to a transportation problem. It starts at the northwest corner of the cost matrix and allocates as much as possible to the cell, then moves either down or right depending on whether the supply or demand has been met.
176+
The method continues until all supply and demand constraints are satisfied.
177+
178+
# Arguments
179+
- `a::TransportationProblem`: The problem in type of TransportationProblem
180+
181+
# Output
182+
- `TransportationResult`: The custom data type that holds problem, solution, and optimum cost.
183+
"""
170184
function northwestcorner(t::TransportationProblem)::TransportationResult
171185
problem = t
172186
if !isbalanced(t)
@@ -202,6 +216,20 @@ function northwestcorner(t::TransportationProblem)::TransportationResult
202216
return result
203217
end
204218

219+
220+
"""
221+
leastcost(a::TransportationProblem)::TransportationResult
222+
223+
# Description
224+
225+
The least cost method is a heuristic for finding an initial basic feasible solution to a transportation problem. It starts by selecting the cell with the lowest cost and allocating as much as possible to that cell, then it moves to the next lowest cost cell and repeats the process until all supply and demand constraints are satisfied.
226+
227+
# Arguments
228+
- `a::TransportationProblem`: The problem in type of TransportationProblem
229+
230+
# Output
231+
- `TransportationResult`: The custom data type that holds problem, solution, and optimum cost.
232+
"""
205233
function leastcost(t::TransportationProblem)::TransportationResult
206234
problem = t
207235
if !isbalanced(t)

0 commit comments

Comments
 (0)