Algorithms
Assignment Problem
OperationsResearchModels.solve
— Methodsolve(a)
Arguments
a::AssignmentProblem
: The problem in type of AssignmentProblem
Output
AssignmentResult
: The custom data type that holds problem, solution, and optimum cost.
Description
Solves an assignment problem given by an object of in type AssignmentProblem
.
Example
julia> mat = [
+Algorithms · OperationsResearchModels.jl Algorithms
Assignment Problem
OperationsResearchModels.solve
— Methodsolve(a)
Arguments
a::AssignmentProblem
: The problem in type of AssignmentProblem
Output
AssignmentResult
: The custom data type that holds problem, solution, and optimum cost.
Description
Solves an assignment problem given by an object of in type AssignmentProblem
.
Example
julia> mat = [
4 8 1;
3 1 9;
1 6 7;
@@ -18,7 +18,7 @@
julia> result.cost
-3.0
sourceTransportation Problem
OperationsResearchModels.solve
— Methodsolve(t)
Arguments
a::TransportationProblem
: The problem in type of TransportationProblem
Output
TransportationResult
: The custom data type that holds problem, solution, and optimum cost.
Description
Solves a transportation problem given by an object of in type TransportationProblem
.
Example
julia> t = TransportationProblem(
+3.0
sourceTransportation Problem
OperationsResearchModels.solve
— Methodsolve(t)
Arguments
a::TransportationProblem
: The problem in type of TransportationProblem
Output
TransportationResult
: The custom data type that holds problem, solution, and optimum cost.
Description
Solves a transportation problem given by an object of in type TransportationProblem
.
Example
julia> t = TransportationProblem(
[ 1 1 1 1;
2 2 2 2;
3 3 3 3],
@@ -49,7 +49,7 @@
Cost:
600.0
Solution:
-[-0.0 -0.0 -0.0 100.0; 100.0 -0.0 -0.0 -0.0; -0.0 -0.0 100.0 -0.0; -0.0 100.0 -0.0 -0.0]
sourceShortest Path and Maximum Flow
solve(c::Vector{Connection}; problem::Union{::ShortestPathProblem, ::MaximumFlowProblem} = ShortestPathProblem)
Arguments
c::Vector{Connection}
: Vector of connections problem
: Type of problem. Either ShortestPathProblem
or MaximumFlowProblem
Example
julia> conns = [
+[-0.0 -0.0 -0.0 100.0; 100.0 -0.0 -0.0 -0.0; -0.0 -0.0 100.0 -0.0; -0.0 100.0 -0.0 -0.0]
sourceShortest Path and Maximum Flow
solve(c::Vector{Connection}; problem::Union{::ShortestPathProblem, ::MaximumFlowProblem} = ShortestPathProblem)
Arguments
c::Vector{Connection}
: Vector of connections problem
: Type of problem. Either ShortestPathProblem
or MaximumFlowProblem
Example
julia> conns = [
Connection(1, 2, 3),
Connection(1, 3, 2),
Connection(1, 4, 4),
@@ -104,7 +104,7 @@
21
julia> result.objective
- 11.531012240599605
sourceOperationsResearchModels.PMedian.pmedian_with_distances
— Functionpmedian_with_distances(distancematrix, ncenters)
Arguments
distancematrix::Matrix
: n x n matrix of distancesncenters::Int
: Number of centers
Description
ncenters
locations are selected that minimizes the total distances to the nearest rows.
Output
PMedianResult
: PMedianResult object.
sourceMinimum Spanning Tree
OperationsResearchModels.MinimumSpanningTree.mst
— Functionmst(connections)
Arguments
connections::Vector{Connection}
: Vector of Connections
Description
Obtains the minimum spanning tree.
Output
::MstResult
: A MstResult object that holds the results.
Examples
julia> conns = Connection[
+ 11.531012240599605
sourceOperationsResearchModels.PMedian.pmedian_with_distances
— Functionpmedian_with_distances(distancematrix, ncenters)
Arguments
distancematrix::Matrix
: n x n matrix of distancesncenters::Int
: Number of centers
Description
ncenters
locations are selected that minimizes the total distances to the nearest rows.
Output
PMedianResult
: PMedianResult object.
sourceMinimum Spanning Tree
OperationsResearchModels.MinimumSpanningTree.mst
— Functionmst(connections)
Arguments
connections::Vector{Connection}
: Vector of Connections
Description
Obtains the minimum spanning tree.
Output
::MstResult
: A MstResult object that holds the results.
Examples
julia> conns = Connection[
Connection(1, 2, 10),
Connection(2, 3, 10),
Connection(3, 4, 10),
@@ -127,7 +127,7 @@
3-element Vector{Connection}:
Connection(3, 4, 10, "x34")
Connection(1, 4, 10, "x14")
- Connection(2, 3, 10, "x23")
sourceCPM (Critical Path Method)
OperationsResearchModels.CPM.cpm
— Functioncpm(activities)
Arguments
activities::Vector{CpmActivity}
Output
::CpmResult
: The object holds the results
Description
Calculates CPM (Critical Path Method) and reports the critical path for a given set of activities.
Example
julia> A = CpmActivity("A", 2);
+ Connection(2, 3, 10, "x23")
sourceCPM (Critical Path Method)
OperationsResearchModels.CPM.cpm
— Functioncpm(activities)
Arguments
activities::Vector{CpmActivity}
Output
::CpmResult
: The object holds the results
Description
Calculates CPM (Critical Path Method) and reports the critical path for a given set of activities.
Example
julia> A = CpmActivity("A", 2);
julia> B = CpmActivity("B", 3);
julia> C = CpmActivity("C", 2, [A]);
julia> D = CpmActivity("D", 3, [B]);
@@ -150,7 +150,7 @@
"I"
julia> result.path == [B, E, G, I]
-true
sourcePERT (Project Evalutation and Review Technique)
OperationsResearchModels.CPM.pert
— Functionpert(activities)
Arguments
activities::Vector{PertActivity}
: Vector of Pert Activities.
Example
julia> A = PertActivity("A", 1, 2, 3)
+true
sourcePERT (Project Evalutation and Review Technique)
OperationsResearchModels.CPM.pert
— Functionpert(activities)
Arguments
activities::Vector{PertActivity}
: Vector of Pert Activities.
Example
julia> A = PertActivity("A", 1, 2, 3)
PertActivity("A", 1.0, 2.0, 3.0, PertActivity[])
julia> B = PertActivity("B", 3, 3, 3)
@@ -172,4 +172,4 @@
8.0
julia> result.stddev
-0.0
source
Settings
This document was generated with Documenter.jl version 1.4.0 on Tuesday 23 April 2024. Using Julia version 1.9.4.