From f6c277db46eb7092a802f64a6449bb0db94c6fae Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Wed, 16 Oct 2024 20:08:37 +0000 Subject: [PATCH] build based on a6e8a35 --- dev/.documenter-siteinfo.json | 2 +- dev/algorithms/index.html | 45 ++++++++++++++++++++++------------ dev/index.html | 2 +- dev/objects.inv | Bin 818 -> 839 bytes dev/search_index.js | 2 +- 5 files changed, 32 insertions(+), 19 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 6bb40a0..a0f31a4 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-16T19:26:05","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2024-10-16T20:08:34","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/dev/algorithms/index.html b/dev/algorithms/index.html index 8cfecd5..71505ca 100644 --- a/dev/algorithms/index.html +++ b/dev/algorithms/index.html @@ -1,5 +1,5 @@ -Algorithms · OperationsResearchModels.jl

Algorithms

Assignment Problem

OperationsResearchModels.solveMethod
solve(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.solveMethod
solve(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
source

Transportation Problem

OperationsResearchModels.solveMethod
solve(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
source

Transportation Problem

OperationsResearchModels.solveMethod
solve(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]
source

Shortest Path

OperationsResearchModels.solveMethod
solve(problem)

Description

Solves a shortest path problem given by an object of in type ShortestPathProblem.

Arguments

problem::ShortestPathProblem: The problem in type of ShortestPathProblem

Output

ShortestPathResult: The custom data type that holds path and cost.

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]
source

Shortest Path

OperationsResearchModels.solveMethod
solve(problem)

Description

Solves a shortest path problem given by an object of in type ShortestPathProblem.

Arguments

problem::ShortestPathProblem: The problem in type of ShortestPathProblem

Output

ShortestPathResult: The custom data type that holds path and cost.

Example

julia> conns = [
                    Connection(1, 2, 3),
                    Connection(1, 3, 2),
                    Connection(1, 4, 4),
@@ -70,7 +70,7 @@
  Connection(6, 7, 5, "x67")
 
 julia> result.cost
-8.0
source

Maximum Flow

OperationsResearchModels.solveMethod
solve(problem)

Arguments

problem::MaximumFlowProblem: The problem in type of MaximumFlowProblem

Output

MaximumFlowResult: The custom data type that holds path and flow.

Example

julia> conns = [
+8.0
source

Maximum Flow

OperationsResearchModels.solveMethod
solve(problem)

Arguments

problem::MaximumFlowProblem: The problem in type of MaximumFlowProblem

Output

MaximumFlowResult: The custom data type that holds path and flow.

Example

julia> conns = [
                    Connection(1, 2, 3),
                    Connection(1, 3, 2),
                    Connection(1, 4, 4),
@@ -97,7 +97,7 @@
  Connection(6, 7, 3.0, "x67")
 
 julia> result.flow
-7.0
source

Minimum Spanning Tree

OperationsResearchModels.solveMethod
solve(problem::MstProblem)

Arguments

  • problem::MstProblem: The problem in type of MstProblem

Description

Obtains the minimum spanning tree.

Output

  • ::MstResult: A MstResult object that holds the results.

Examples

julia> conns = Connection[
+7.0
source

Minimum Spanning Tree

OperationsResearchModels.solveMethod
solve(problem::MstProblem)

Arguments

  • problem::MstProblem: The problem in type of MstProblem

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),
@@ -120,7 +120,7 @@
  3-element Vector{Connection}:
   Connection(3, 4, 10, "x34")
   Connection(1, 4, 10, "x14")
-  Connection(2, 3, 10, "x23")
source

pmedian

OperationsResearchModels.PMedian.pmedianFunction
pmedian(data, ncenters)

Arguments

  • data::Matrix: Coordinates of locations
  • ncenters::Int: Number of centers

Description

The function calculates Euclidean distances between all possible rows of the matrix data. ncenters locations are then selected that minimizes the total distances to the nearest rows.

Output

  • PMedianResult: PMedianResult object.

Example

julia> data1 = rand(10, 2);
+  Connection(2, 3, 10, "x23")
source

pmedian

OperationsResearchModels.PMedian.pmedianFunction
pmedian(data, ncenters)

Arguments

  • data::Matrix: Coordinates of locations
  • ncenters::Int: Number of centers

Description

The function calculates Euclidean distances between all possible rows of the matrix data. ncenters locations are then selected that minimizes the total distances to the nearest rows.

Output

  • PMedianResult: PMedianResult object.

Example

julia> data1 = rand(10, 2);
 
 julia> data2 = rand(10, 2) .+ 50;
 
@@ -137,7 +137,7 @@
  21
 
  julia> result.objective
- 11.531012240599605
source

pmedian with distances

OperationsResearchModels.PMedian.pmedian_with_distancesFunction
pmedian_with_distances(distancematrix, ncenters)

Arguments

  • distancematrix::Matrix: n x n matrix of distances
  • ncenters::Int: Number of centers

Description

  • ncenters locations are selected that minimizes the total distances to the nearest rows.

Output

  • PMedianResult: PMedianResult object.
source

CPM (Critical Path Method)

OperationsResearchModels.solveMethod
solve(problem)

Arguments

  • problem::CpmProblem: The problem in type of CpmProblem.

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);
+ 11.531012240599605
source

pmedian with distances

OperationsResearchModels.PMedian.pmedian_with_distancesFunction
pmedian_with_distances(distancematrix, ncenters)

Arguments

  • distancematrix::Matrix: n x n matrix of distances
  • ncenters::Int: Number of centers

Description

  • ncenters locations are selected that minimizes the total distances to the nearest rows.

Output

  • PMedianResult: PMedianResult object.
source

CPM (Critical Path Method)

OperationsResearchModels.solveMethod
solve(problem)

Arguments

  • problem::CpmProblem: The problem in type of CpmProblem.

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]);
@@ -162,12 +162,12 @@
  "I"
 
  julia> result.path == [B, E, G, I]
-true
source

CPM Activity

OperationsResearchModels.CPM.CpmActivityType
CpmActivity(name::String, time::Float64, dependencies)

Description

The object that represents an activity in CPM (Critical Path Method).

Arguments

  • name::String: The name of the activity.
  • time::Float64: The time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{CpmActivity}.

Example

julia> A = CpmActivity("A", 2, []);
+true
source

CPM Activity

OperationsResearchModels.CPM.CpmActivityType
CpmActivity(name::String, time::Float64, dependencies)

Description

The object that represents an activity in CPM (Critical Path Method).

Arguments

  • name::String: The name of the activity.
  • time::Float64: The time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{CpmActivity}.

Example

julia> A = CpmActivity("A", 2, []);
 
 julia> B = CpmActivity("B", 3, []);
 
 julia> C = CpmActivity("C", 2, [A, B]);
-
source

PERT (Project Evalutation and Review Technique)

OperationsResearchModels.solveMethod
solve(problem::PertProblem)::PertResult

Arguments

  • problem::PertProblem: The problem in type of PertProblem.

Example

julia> A = PertActivity("A", 1, 2, 3)
+
source

PERT (Project Evalutation and Review Technique)

OperationsResearchModels.solveMethod
solve(problem::PertProblem)::PertResult

Arguments

  • problem::PertProblem: The problem in type of PertProblem.

Example

julia> A = PertActivity("A", 1, 2, 3)
 PertActivity("A", 1.0, 2.0, 3.0, PertActivity[])
 
 julia> B = PertActivity("B", 3, 3, 3)
@@ -191,12 +191,12 @@
 8.0
 
 julia> result.stddev
-0.0
source

PERT Activity

OperationsResearchModels.CPM.PertActivityType
PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity

Description

The object that represents an activity in PERT (Program Evaluation and Review Technique).

Arguments

  • name::String: The name of the activity.
  • o::Float64: The optimistic time of the activity.
  • m::Float64: The most likely time of the activity.
  • p::Float64: The pessimistic time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{PertActivity}.

Example

julia> A = PertActivity("A", 1, 2, 3);
+0.0
source

PERT Activity

OperationsResearchModels.CPM.PertActivityType
PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity

Description

The object that represents an activity in PERT (Program Evaluation and Review Technique).

Arguments

  • name::String: The name of the activity.
  • o::Float64: The optimistic time of the activity.
  • m::Float64: The most likely time of the activity.
  • p::Float64: The pessimistic time of the activity.
  • dependencies: The dependencies of the activity in type of Vector{PertActivity}.

Example

julia> A = PertActivity("A", 1, 2, 3);
 julia> B = PertActivity("B", 3, 3, 4);
-julia> C = PertActivity("C", 5, 6, 7, [A, B]);
source

Knapsack

OperationsResearchModels.solveMethod
solve(problem::KnapsackProblem)::KnapsackResult

Description

Solves the knapsack problem.

Arguments

  • problem::KnapsackProblem: The problem in type of KnapsackProblem.

Output

  • KnapsackResult: The custom data type that holds selected items, model, and objective value.

Example

julia> values = [10, 20, 30, 40, 50];
+julia> C = PertActivity("C", 5, 6, 7, [A, B]);
source

Knapsack

OperationsResearchModels.solveMethod
solve(problem::KnapsackProblem)::KnapsackResult

Description

Solves the knapsack problem.

Arguments

  • problem::KnapsackProblem: The problem in type of KnapsackProblem.

Output

  • KnapsackResult: The custom data type that holds selected items, model, and objective value.

Example

julia> values = [10, 20, 30, 40, 50];
 julia> weights = [1, 2, 3, 4, 5];
 julia> capacity = 10;
-julia> solve(KnapsackProblem(values, weights, capacity));
source

Johnson's Rule

OperationsResearchModels.Johnsons.johnsonsFunction
johnsons(times::Matrix)

Given a matrix of times, returns a JohnsonResult with the permutation of the jobs. If number of machines is 2, it uses the Johnson's algorithm for 2 machines. If number of machines is greater than 2, it uses the Johnson's algorithm by transforming the problem into a 2-machine problem. In order to reduce the original problem to a 2-machine problem, the algorithm checks if the minimum time of the first machine is greater or equal than the maximum time of the other machines and/or if the minimum time of the last machine is greater or equal than the maximum time of the other machines.

For example if we have 4 machines, namely, A, B, C, and D at least one of the following conditions must be satisfied:

  • min(A) >= max(B, C)
  • min(D) >= max(B, C)

The function throws a JohnsonException if the problem cannot be reduced to a 2-machine problem.

Arguments

  • times::Matrix: a matrix of times

Returns

  • JohnsonResult: a custom data type that holds the permutation of the jobs

Example

times = Float64[
+julia> solve(KnapsackProblem(values, weights, capacity));
source

Johnson's Rule

OperationsResearchModels.Johnsons.johnsonsFunction
johnsons(times::Matrix)

Given a matrix of times, returns a JohnsonResult with the permutation of the jobs. If number of machines is 2, it uses the Johnson's algorithm for 2 machines. If number of machines is greater than 2, it uses the Johnson's algorithm by transforming the problem into a 2-machine problem. In order to reduce the original problem to a 2-machine problem, the algorithm checks if the minimum time of the first machine is greater or equal than the maximum time of the other machines and/or if the minimum time of the last machine is greater or equal than the maximum time of the other machines.

For example if we have 4 machines, namely, A, B, C, and D at least one of the following conditions must be satisfied:

  • min(A) >= max(B, C)
  • min(D) >= max(B, C)

The function throws a JohnsonException if the problem cannot be reduced to a 2-machine problem.

Arguments

  • times::Matrix: a matrix of times

Returns

  • JohnsonResult: a custom data type that holds the permutation of the jobs

Example

times = Float64[
     3.1 2.8;
     4.0 7.0;
     8.0 3.0;
@@ -208,7 +208,7 @@
 
 result = johnsons(times)
 
-println(result.permutation)
source

Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule

OperationsResearchModels.Johnsons.johnsons_gaFunction
johnsons_ga(times::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::JohnsonResult

Given a matrix of times, returns a JohnsonResult with the permutation of the jobs. The function uses a genetic algorithm to find the best permutation of the jobs. The genetic algorithm is implemented in the RandomKeyGA module.

Arguments

  • times::Matrix: a matrix of times
  • popsize::Int: the population size. Default is 100
  • ngen::Int: the number of generations. Default is 1000
  • pcross::Float64: the crossover probability. Default is 0.8
  • pmutate::Float64: the mutation probability. Default is 0.01
  • nelites::Int: the number of elites. Default is 1

Returns

  • JohnsonResult: a custom data type that holds the permutation of the jobs

Example

times = Float64[
+println(result.permutation)
source

Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule

OperationsResearchModels.Johnsons.johnsons_gaFunction
johnsons_ga(times::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::JohnsonResult

Given a matrix of times, returns a JohnsonResult with the permutation of the jobs. The function uses a genetic algorithm to find the best permutation of the jobs. The genetic algorithm is implemented in the RandomKeyGA module.

Arguments

  • times::Matrix: a matrix of times
  • popsize::Int: the population size. Default is 100
  • ngen::Int: the number of generations. Default is 1000
  • pcross::Float64: the crossover probability. Default is 0.8
  • pmutate::Float64: the mutation probability. Default is 0.01
  • nelites::Int: the number of elites. Default is 1

Returns

  • JohnsonResult: a custom data type that holds the permutation of the jobs

Example

times = Float64[
     3.1 2.8;
     4.0 7.0;
     8.0 3.0;
@@ -220,7 +220,7 @@
 
 result = johnsons(times)
 
-println(result.permutation)
source

Makespan

Makespan

OperationsResearchModels.Johnsons.makespanFunction
makespan(times::Matrix, permutation::Vector{Int})
 
 Given a matrix of times and a permutation of the jobs, returns the makespan of the jobs.

Arguments

  • times::Matrix: a matrix of times
  • permutation::Vector{Int}: a permutation of the jobs

Returns

  • Float64: the makespan of the jobs

Example


 julia> times = Float64[
@@ -231,7 +231,7 @@
     2 5 6    
 ]
 
-julia> result = makespan(times, [1, 4, 5, 3, 2])
source

Traveling Salesman

OperationsResearchModels.TravelingSalesman.travelingsalesmanFunction
travelingsalesman(distancematrix::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::TravelinSalesmenResult

Given a matrix of distances, returns a TravelinSalesmenResult with the best route and its cost.

Arguments

  • distancematrix::Matrix: a matrix of distances
  • popsize::Int: the population size. Default is 100
  • ngen::Int: the number of generations. Default is 1000
  • pcross::Float64: the crossover probability. Default is 0.8
  • pmutate::Float64: the mutation probability. Default is 0.01
  • nelites::Int: the number of elites. Default is 1

Returns

  • TravelinSalesmenResult: a custom data type that holds the best route and its cost

Example

pts = Float64[
+julia> result = makespan(times, [1, 4, 5, 3, 2])
source

Traveling Salesman

OperationsResearchModels.TravelingSalesman.travelingsalesmanFunction
travelingsalesman(distancematrix::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::TravelinSalesmenResult

Given a matrix of distances, returns a TravelinSalesmenResult with the best route and its cost.

Arguments

  • distancematrix::Matrix: a matrix of distances
  • popsize::Int: the population size. Default is 100
  • ngen::Int: the number of generations. Default is 1000
  • pcross::Float64: the crossover probability. Default is 0.8
  • pmutate::Float64: the mutation probability. Default is 0.01
  • nelites::Int: the number of elites. Default is 1

Returns

  • TravelinSalesmenResult: a custom data type that holds the best route and its cost

Example

pts = Float64[
     0 0;
     0 1;
     0 2;
@@ -257,4 +257,17 @@
     end 
 end
 
-result = travelingsalesman(distmat, ngen = 1000, popsize = 100, pcross = 1.0, pmutate = 0.10)
source
+result = travelingsalesman(distmat, ngen = 1000, popsize = 100, pcross = 1.0, pmutate = 0.10)
source

Simplex

OperationsResearchModels.Simplex.createsimplexproblemFunction
createsimplexproblem(obj::Vector, amat::Matrix, rhs::Vector, dir::Vector, opttype::OptimizationType)::SimplexProblem

Description:

This function creates a SimplexProblem object from the given parameters.

Arguments:

  • obj::Vector: The objective function coefficients.
  • amat::Matrix: The LHS of the constraints.
  • rhs::Vector: The RHS of the constraints.
  • dir::Vector: The directions of the constraints. Can be a vector of LE (<=), GE (>=), or EQ (==).
  • opttype::OptimizationType: The type of the optimization. Can be Maximize or Minimize.

Returns:

A SimplexProblem object.

Example:

Suppose the linear programming problem is as follows:

Maximize: 1.0x1 + 2.0x2 + 3.0x3
+Subject to:
+1.0x1 + 2.0x2 + 3.0x3 <= 10.0
+3.0x1 + 1.0x2 + 5.0x3 <= 15.0
+x1, x2 >= 0

The following code creates a SimplexProblem object for the above problem:

using OperationsResearch.Simplex
+
+obj = Float64[1.0, 2.0, 3.0]
+amat = Float64[1.0 2.0 3.0; 3.0 1.0 5.0]
+rhs = Float64[10.0, 15.0]
+dir = [LE, LE]
+opttype = Maximize
+
+s = createsimplexproblem(obj, amat, rhs, dir, opttype)
+iters = simplexiterations(s)
source
diff --git a/dev/index.html b/dev/index.html index b3c9d1b..30d9573 100644 --- a/dev/index.html +++ b/dev/index.html @@ -1,2 +1,2 @@ -- · OperationsResearchModels.jl

Operations Research Models

The OperationsResearchModels package includes basic Operations Research subjects such as Transportation Problem, Assignment Problem, Minimum Spanning Tree, Shortest Path, Maximum Flow, and p-medians method for selecting location of facilities.

Package content is incrementaly updated.

Please refer the Algorithms section for the detailed documentation.

+- · OperationsResearchModels.jl

Operations Research Models

The OperationsResearchModels package includes basic Operations Research subjects such as Transportation Problem, Assignment Problem, Minimum Spanning Tree, Shortest Path, Maximum Flow, and p-medians method for selecting location of facilities.

Package content is incrementaly updated.

Please refer the Algorithms section for the detailed documentation.

diff --git a/dev/objects.inv b/dev/objects.inv index 8fe5ed5b7efb1abd2a2d2b42cc6a7c9d4716ff0d..135bed092a93b1a3d4ac2191f352739a6a93f79a 100644 GIT binary patch delta 690 zcmV;j0!{t02FC`Fkbhlo(=Zf$&#$-=RE!4~v6sQ#${0wXh>G@oa+ABpn`4LA={6z$ zJJ(K}tnHd+Ro?P(&hh=e=5nn|VYA$TvFT;16JQ^Kw_iWNtbLB=*T0u+mRPY7_Q~TV zU!mM#ym<=_2mu&f&Er8V!gZwCwqXY-EGlwL1y}u`MW#!O#tyPMw^<)F0Koyh;b&L$ zlOF*Ve|sNWNq-77lF_dMOKyc$hW$o^yiACwQbyp%xtjT1MSAXC!-v ziDlOtE-UM^$GA!<*BgNkY>7#x#GeX#YRd~zaSfGn1?O8a91hPIKn$oE&>bGdLit!P z3a*sP*|Nl*GNPc@1PBChgy=geq#9>!8?#$oGMgbQ>hKzR;g%&t(w41|87()M*3qtv ze>-_-DUWzo*A9(nH~xS`fkYvQf)j;W6jo%P7p;@;MR!{&=J#ldW3!6tUzvi&P@UHS zwY$w|>$e*cVMf#=V(JZL%ZmE@?;K0p5dOiPyv+SDg6$)QC`~TDJky$7d?i;7@@NW9 z9lG5Lbh3Ra5cb0{$cw8YAIphO>WB~Xf7mzsG&DV(dt0f*r{F|4x*;@{H+zaloO*7} zc3F*O(Tl1_tZMqmOz)b9n>9Z*-tBq`+huCQ7ZbMA2&s(CXgTbp26Ppb?^sP0mit(K z?C8Cs62q;`U6;nP<^|1HSk&A!+(l!wH1A0c?TS3?l@sfBXOi8x4R+IAcurJp7%q_0 Yq(n}EuHTy7d8+2#AUGoQ9}@(swWUl>XaE2J delta 686 zcmV;f0#W_P2C@c_kblc=+b|Hk>nj#$jiv{>XfA1UbJMgy3!z5hyFp7EiwQ-lBIPtF z`tMy*q7>V)tQflaF*Dr9?2=rrbt!C?8!$G#Omzb6Bk=au4=`&#NAv5O1)C*SY=nLC zc*$2NcNlNpf&)STMpyHA5Q}gfX|^5M0Sb$X98O zm>m=X6l!SnLublp^^Qa;iHGBCaFg?k2H6t9eT{x9UKpM{^cQwf@(oI%*6fx`G#IoxRmzDL6VO*uu#*M&7w!kD);&+8Tw(&ybo1s$9OMc42;qZ(B z#DJOs-QiIzl&|$|!Ig47Ta?)25Gs02fIt98h`ysjvVSjYCzRdklGzMdQJ2@y7j9WX zByHIWnbC5CXAL9vsA>zPN$N&HU diff --git a/dev/search_index.js b/dev/search_index.js index 9e9cabc..3b12130 100644 --- a/dev/search_index.js +++ b/dev/search_index.js @@ -1,3 +1,3 @@ var documenterSearchIndex = {"docs": -[{"location":"#Operations-Research-Models","page":"-","title":"Operations Research Models","text":"","category":"section"},{"location":"","page":"-","title":"-","text":"The OperationsResearchModels package includes basic Operations Research subjects such as Transportation Problem, Assignment Problem, Minimum Spanning Tree, Shortest Path, Maximum Flow, and p-medians method for selecting location of facilities. ","category":"page"},{"location":"","page":"-","title":"-","text":"Package content is incrementaly updated.","category":"page"},{"location":"","page":"-","title":"-","text":"Please refer the Algorithms section for the detailed documentation. ","category":"page"},{"location":"algorithms/#Algorithms","page":"Algorithms","title":"Algorithms","text":"","category":"section"},{"location":"algorithms/#Assignment-Problem","page":"Algorithms","title":"Assignment Problem","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(a::AssignmentProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{AssignmentProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(a)\n\nArguments\n\na::AssignmentProblem: The problem in type of AssignmentProblem\n\nOutput\n\nAssignmentResult: The custom data type that holds problem, solution, and optimum cost. \n\nDescription\n\nSolves an assignment problem given by an object of in type AssignmentProblem.\n\nExample\n\njulia> mat = [\n 4 8 1;\n 3 1 9;\n 1 6 7;\n ];\n\njulia> problem = AssignmentProblem(mat);\n\njulia> result = solve(problem);\n\njulia> result.solution\n\n3×3 Matrix{Float64}:\n 0.0 0.0 1.0\n 0.0 1.0 0.0\n 1.0 0.0 0.0\n\njulia> result.cost\n\n3.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Transportation-Problem","page":"Algorithms","title":"Transportation Problem","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::TransportationProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{TransportationProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(t)\n\nArguments\n\na::TransportationProblem: The problem in type of TransportationProblem\n\nOutput\n\nTransportationResult: The custom data type that holds problem, solution, and optimum cost. \n\nDescription\n\nSolves a transportation problem given by an object of in type TransportationProblem.\n\nExample\n\njulia> t = TransportationProblem(\n [ 1 1 1 1; \n 2 2 2 2; \n 3 3 3 3], \n [100, 100, 100, 100], # Demands \n [100, 100, 100]) # Supplies \nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100]\n\njulia> isbalanced(t)\nfalse\n\njulia> result = solve(t)\nTransportation Results:\nMain problem:\nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100]\n\nBalanced problem:\nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3; 0 0 0 0]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100, 100]\n\nCost:\n600.0\nSolution:\n[-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]\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Shortest-Path","page":"Algorithms","title":"Shortest Path","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::ShortestPathProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{ShortestPathProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nDescription\n\nSolves a shortest path problem given by an object of in type ShortestPathProblem.\n\nArguments\n\nproblem::ShortestPathProblem: The problem in type of ShortestPathProblem\n\nOutput\n\nShortestPathResult: The custom data type that holds path and cost.\n\nExample\n\njulia> conns = [\n Connection(1, 2, 3),\n Connection(1, 3, 2),\n Connection(1, 4, 4),\n Connection(2, 5, 3),\n Connection(3, 5, 1),\n Connection(3, 6, 1),\n Connection(4, 6, 2),\n Connection(5, 7, 6),\n Connection(6, 7, 5),\n ];\n\njulia> solve(ShortestPathProblem(conns));\n\njulia> result.path\n3-element Vector{Connection}:\n Connection(1, 3, 2, \"x13\")\n Connection(3, 6, 1, \"x36\")\n Connection(6, 7, 5, \"x67\")\n\njulia> result.cost\n8.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Maximum-Flow","page":"Algorithms","title":"Maximum Flow","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::MaximumFlowProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{MaximumFlowProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nArguments\n\nproblem::MaximumFlowProblem: The problem in type of MaximumFlowProblem\n\nOutput\n\nMaximumFlowResult: The custom data type that holds path and flow.\n\nExample\n\njulia> conns = [\n Connection(1, 2, 3),\n Connection(1, 3, 2),\n Connection(1, 4, 4),\n Connection(2, 5, 3),\n Connection(3, 5, 1),\n Connection(3, 6, 1),\n Connection(4, 6, 2),\n Connection(5, 7, 6),\n Connection(6, 7, 5),\n ];\njulia> problem = MaximumFlowProblem(conns)\njulia> result = solve(problem);\n\njulia> result.path\n9-element Vector{Connection}:\n Connection(1, 2, 3.0, \"x12\")\n Connection(1, 3, 2.0, \"x13\")\n Connection(1, 4, 2.0, \"x14\")\n Connection(2, 5, 3.0, \"x25\")\n Connection(3, 5, 1.0, \"x35\")\n Connection(3, 6, 1.0, \"x36\")\n Connection(4, 6, 2.0, \"x46\")\n Connection(5, 7, 4.0, \"x57\")\n Connection(6, 7, 3.0, \"x67\")\n\njulia> result.flow\n7.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Minimum-Spanning-Tree","page":"Algorithms","title":"Minimum Spanning Tree","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(p::MstProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{MstProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::MstProblem)\n\nArguments\n\nproblem::MstProblem: The problem in type of MstProblem\n\nDescription\n\nObtains the minimum spanning tree. \n\nOutput\n\n::MstResult: A MstResult object that holds the results. \n\nExamples\n\njulia> conns = Connection[\n Connection(1, 2, 10),\n Connection(2, 3, 10),\n Connection(3, 4, 10),\n Connection(1, 4, 10)\n ]\n\n4-element Vector{Connection}:\n Connection(1, 2, 10, \"x12\")\n Connection(2, 3, 10, \"x23\")\n Connection(3, 4, 10, \"x34\")\n Connection(1, 4, 10, \"x14\")\n\n julia> result = solve(MstProblem(conns))\n MstResult(Connection[Connection(3, 4, 10, \"x34\"), Connection(1, 4, 10, \"x14\"), Connection(2, 3, 10, \"x23\")], 30.0)\n \n julia> result.distance\n 30.0\n \n julia> result.connections\n 3-element Vector{Connection}:\n Connection(3, 4, 10, \"x34\")\n Connection(1, 4, 10, \"x14\")\n Connection(2, 3, 10, \"x23\")\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#pmedian","page":"Algorithms","title":"pmedian","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.pmedian","category":"page"},{"location":"algorithms/#OperationsResearchModels.PMedian.pmedian","page":"Algorithms","title":"OperationsResearchModels.PMedian.pmedian","text":"pmedian(data, ncenters)\n\nArguments\n\ndata::Matrix: Coordinates of locations \nncenters::Int: Number of centers \n\nDescription\n\nThe function calculates Euclidean distances between all possible rows of the matrix data. ncenters locations are then selected that minimizes the total distances to the nearest rows. \n\nOutput\n\nPMedianResult: PMedianResult object. \n\nExample\n\njulia> data1 = rand(10, 2);\n\njulia> data2 = rand(10, 2) .+ 50;\n\njulia> data3 = rand(10, 2) .+ 100;\n\njulia> data = vcat(data1, data2, data3);\n\njulia> result = pmedian(data, 3);\n\njulia> result.centers\n3-element Vector{Int64}:\n 1\n 16\n 21\n\n julia> result.objective\n 11.531012240599605\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#pmedian-with-distances","page":"Algorithms","title":"pmedian with distances","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.pmedian_with_distances","category":"page"},{"location":"algorithms/#OperationsResearchModels.PMedian.pmedian_with_distances","page":"Algorithms","title":"OperationsResearchModels.PMedian.pmedian_with_distances","text":"pmedian_with_distances(distancematrix, ncenters)\n\nArguments\n\ndistancematrix::Matrix: n x n matrix of distances\nncenters::Int: Number of centers \n\nDescription\n\nncenters locations are selected that minimizes the total distances to the nearest rows. \n\nOutput\n\nPMedianResult: PMedianResult object. \n\n\n\n\n\n","category":"function"},{"location":"algorithms/#CPM-(Critical-Path-Method)","page":"Algorithms","title":"CPM (Critical Path Method)","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(problem::CpmProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{CpmProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nArguments\n\nproblem::CpmProblem: The problem in type of CpmProblem.\n\nOutput\n\n::CpmResult: The object holds the results \n\nDescription\n\nCalculates CPM (Critical Path Method) and reports the critical path for a given set of activities. \n\nExample\n\njulia> A = CpmActivity(\"A\", 2);\njulia> B = CpmActivity(\"B\", 3);\njulia> C = CpmActivity(\"C\", 2, [A]);\njulia> D = CpmActivity(\"D\", 3, [B]);\njulia> E = CpmActivity(\"E\", 2, [B]);\njulia> F = CpmActivity(\"F\", 3, [C, D]);\njulia> G = CpmActivity(\"G\", 7, [E]);\njulia> H = CpmActivity(\"H\", 5, [E]);\njulia> I = CpmActivity(\"I\", 6, [G, F]);\njulia> J = CpmActivity(\"J\", 2, [C, D]);\n\njulia> activities = [A, B, C, D, E, F, G, H, I, J];\n\njulia> problem = CpmProblem(activities);\n\njulia> result = solve(problem);\n\njulia> result.pathstr\n4-element Vector{String}:\n \"B\"\n \"E\"\n \"G\"\n \"I\"\n\n julia> result.path == [B, E, G, I]\ntrue\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#CPM-Activity","page":"Algorithms","title":"CPM Activity","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.CpmActivity","category":"page"},{"location":"algorithms/#OperationsResearchModels.CPM.CpmActivity","page":"Algorithms","title":"OperationsResearchModels.CPM.CpmActivity","text":"CpmActivity(name::String, time::Float64, dependencies)\n\nDescription\n\nThe object that represents an activity in CPM (Critical Path Method).\n\nArguments\n\nname::String: The name of the activity.\ntime::Float64: The time of the activity.\ndependencies: The dependencies of the activity in type of Vector{CpmActivity}.\n\nExample\n\njulia> A = CpmActivity(\"A\", 2, []);\n\njulia> B = CpmActivity(\"B\", 3, []);\n\njulia> C = CpmActivity(\"C\", 2, [A, B]);\n\n\n\n\n\n\n","category":"type"},{"location":"algorithms/#PERT-(Project-Evalutation-and-Review-Technique)","page":"Algorithms","title":"PERT (Project Evalutation and Review Technique)","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(problem::PertProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{PertProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::PertProblem)::PertResult\n\nArguments\n\nproblem::PertProblem: The problem in type of PertProblem.\n\nExample\n\njulia> A = PertActivity(\"A\", 1, 2, 3)\nPertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[])\n\njulia> B = PertActivity(\"B\", 3, 3, 3)\nPertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])\n\njulia> C = PertActivity(\"C\", 5, 5, 5, [A, B])\nPertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])\n\njulia> activities = [A, B, C]\n3-element Vector{PertActivity}:\n PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[])\n PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])\n PertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])\n\njulia> problem = PertProblem(activities);\n\njulia> result = pert(activities)\nPertResult(PertActivity[PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[]), PertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])], 8.0, 0.0)\n\njulia> result.mean\n8.0\n\njulia> result.stddev\n0.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#PERT-Activity","page":"Algorithms","title":"PERT Activity","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.PertActivity","category":"page"},{"location":"algorithms/#OperationsResearchModels.CPM.PertActivity","page":"Algorithms","title":"OperationsResearchModels.CPM.PertActivity","text":"PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity\n\nDescription\n\nThe object that represents an activity in PERT (Program Evaluation and Review Technique).\n\nArguments\n\nname::String: The name of the activity.\no::Float64: The optimistic time of the activity.\nm::Float64: The most likely time of the activity.\np::Float64: The pessimistic time of the activity.\ndependencies: The dependencies of the activity in type of Vector{PertActivity}.\n\nExample\n\njulia> A = PertActivity(\"A\", 1, 2, 3);\njulia> B = PertActivity(\"B\", 3, 3, 4);\njulia> C = PertActivity(\"C\", 5, 6, 7, [A, B]);\n\n\n\n\n\n","category":"type"},{"location":"algorithms/#Knapsack","page":"Algorithms","title":"Knapsack","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(p::KnapsackProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{KnapsackProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::KnapsackProblem)::KnapsackResult\n\nDescription\n\nSolves the knapsack problem.\n\nArguments\n\nproblem::KnapsackProblem: The problem in type of KnapsackProblem.\n\nOutput\n\nKnapsackResult: The custom data type that holds selected items, model, and objective value.\n\nExample\n\njulia> values = [10, 20, 30, 40, 50];\njulia> weights = [1, 2, 3, 4, 5];\njulia> capacity = 10;\njulia> solve(KnapsackProblem(values, weights, capacity));\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Johnson's-Rule","page":"Algorithms","title":"Johnson's Rule","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.johnsons","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.johnsons","page":"Algorithms","title":"OperationsResearchModels.Johnsons.johnsons","text":"johnsons(times::Matrix)\n\nGiven a matrix of times, returns a JohnsonResult with the permutation of the jobs. If number of machines is 2, it uses the Johnson's algorithm for 2 machines. If number of machines is greater than 2, it uses the Johnson's algorithm by transforming the problem into a 2-machine problem. In order to reduce the original problem to a 2-machine problem, the algorithm checks if the minimum time of the first machine is greater or equal than the maximum time of the other machines and/or if the minimum time of the last machine is greater or equal than the maximum time of the other machines.\n\nFor example if we have 4 machines, namely, A, B, C, and D at least one of the following conditions must be satisfied:\n\nmin(A) >= max(B, C)\nmin(D) >= max(B, C)\n\nThe function throws a JohnsonException if the problem cannot be reduced to a 2-machine problem.\n\nArguments\n\ntimes::Matrix: a matrix of times\n\nReturns\n\nJohnsonResult: a custom data type that holds the permutation of the jobs\n\nExample\n\ntimes = Float64[\n 3.1 2.8;\n 4.0 7.0;\n 8.0 3.0;\n 5.0 8.0;\n 6.0 4.0;\n 8.0 5.0;\n 7.0 4.0\n]\n\nresult = johnsons(times)\n\nprintln(result.permutation)\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Genetic-Algorithm-for-the-problems-that-cannot-be-solved-with-using-Johnson's-Rule","page":"Algorithms","title":"Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.johnsons_ga","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.johnsons_ga","page":"Algorithms","title":"OperationsResearchModels.Johnsons.johnsons_ga","text":"johnsons_ga(times::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::JohnsonResult\n\nGiven a matrix of times, returns a JohnsonResult with the permutation of the jobs. The function uses a genetic algorithm to find the best permutation of the jobs. The genetic algorithm is implemented in the RandomKeyGA module.\n\nArguments\n\ntimes::Matrix: a matrix of times\npopsize::Int: the population size. Default is 100\nngen::Int: the number of generations. Default is 1000\npcross::Float64: the crossover probability. Default is 0.8\npmutate::Float64: the mutation probability. Default is 0.01\nnelites::Int: the number of elites. Default is 1\n\nReturns\n\nJohnsonResult: a custom data type that holds the permutation of the jobs\n\nExample\n\ntimes = Float64[\n 3.1 2.8;\n 4.0 7.0;\n 8.0 3.0;\n 5.0 8.0;\n 6.0 4.0;\n 8.0 5.0;\n 7.0 4.0\n]\n\nresult = johnsons(times)\n\nprintln(result.permutation)\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Makespan","page":"Algorithms","title":"Makespan","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.makespan","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.makespan","page":"Algorithms","title":"OperationsResearchModels.Johnsons.makespan","text":"makespan(times::Matrix, permutation::Vector{Int})\n\nGiven a matrix of times and a permutation of the jobs, returns the makespan of the jobs.\n\nArguments\n\ntimes::Matrix: a matrix of times\npermutation::Vector{Int}: a permutation of the jobs\n\nReturns\n\nFloat64: the makespan of the jobs\n\nExample\n\n\njulia> times = Float64[\n 3 3 5;\n 8 4 8;\n 7 2 10;\n 5 1 7;\n 2 5 6 \n]\n\njulia> result = makespan(times, [1, 4, 5, 3, 2])\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Traveling-Salesman","page":"Algorithms","title":"Traveling Salesman","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.travelingsalesman","category":"page"},{"location":"algorithms/#OperationsResearchModels.TravelingSalesman.travelingsalesman","page":"Algorithms","title":"OperationsResearchModels.TravelingSalesman.travelingsalesman","text":"travelingsalesman(distancematrix::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::TravelinSalesmenResult\n\nGiven a matrix of distances, returns a TravelinSalesmenResult with the best route and its cost.\n\nArguments\n\ndistancematrix::Matrix: a matrix of distances\npopsize::Int: the population size. Default is 100\nngen::Int: the number of generations. Default is 1000\npcross::Float64: the crossover probability. Default is 0.8\npmutate::Float64: the mutation probability. Default is 0.01\nnelites::Int: the number of elites. Default is 1\n\nReturns\n\nTravelinSalesmenResult: a custom data type that holds the best route and its cost\n\nExample\n\npts = Float64[\n 0 0;\n 0 1;\n 0 2;\n 1 2;\n 2 2;\n 3 2;\n 4 2; \n 5 2;\n 5 1;\n 5 0;\n 4 0;\n 3 0;\n 2 0;\n 1 0;\n]\n\nn = size(pts, 1\ndistmat = zeros(n, n)\n\nfor i in 1:n\n for j in 1:n\n distmat[i, j] = sqrt(sum((pts[i, :] .- pts[j, :]).^2))\n end \nend\n\nresult = travelingsalesman(distmat, ngen = 1000, popsize = 100, pcross = 1.0, pmutate = 0.10)\n\n\n\n\n\n","category":"function"}] +[{"location":"#Operations-Research-Models","page":"-","title":"Operations Research Models","text":"","category":"section"},{"location":"","page":"-","title":"-","text":"The OperationsResearchModels package includes basic Operations Research subjects such as Transportation Problem, Assignment Problem, Minimum Spanning Tree, Shortest Path, Maximum Flow, and p-medians method for selecting location of facilities. ","category":"page"},{"location":"","page":"-","title":"-","text":"Package content is incrementaly updated.","category":"page"},{"location":"","page":"-","title":"-","text":"Please refer the Algorithms section for the detailed documentation. ","category":"page"},{"location":"algorithms/#Algorithms","page":"Algorithms","title":"Algorithms","text":"","category":"section"},{"location":"algorithms/#Assignment-Problem","page":"Algorithms","title":"Assignment Problem","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(a::AssignmentProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{AssignmentProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(a)\n\nArguments\n\na::AssignmentProblem: The problem in type of AssignmentProblem\n\nOutput\n\nAssignmentResult: The custom data type that holds problem, solution, and optimum cost. \n\nDescription\n\nSolves an assignment problem given by an object of in type AssignmentProblem.\n\nExample\n\njulia> mat = [\n 4 8 1;\n 3 1 9;\n 1 6 7;\n ];\n\njulia> problem = AssignmentProblem(mat);\n\njulia> result = solve(problem);\n\njulia> result.solution\n\n3×3 Matrix{Float64}:\n 0.0 0.0 1.0\n 0.0 1.0 0.0\n 1.0 0.0 0.0\n\njulia> result.cost\n\n3.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Transportation-Problem","page":"Algorithms","title":"Transportation Problem","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::TransportationProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{TransportationProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(t)\n\nArguments\n\na::TransportationProblem: The problem in type of TransportationProblem\n\nOutput\n\nTransportationResult: The custom data type that holds problem, solution, and optimum cost. \n\nDescription\n\nSolves a transportation problem given by an object of in type TransportationProblem.\n\nExample\n\njulia> t = TransportationProblem(\n [ 1 1 1 1; \n 2 2 2 2; \n 3 3 3 3], \n [100, 100, 100, 100], # Demands \n [100, 100, 100]) # Supplies \nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100]\n\njulia> isbalanced(t)\nfalse\n\njulia> result = solve(t)\nTransportation Results:\nMain problem:\nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100]\n\nBalanced problem:\nTransportation Problem:\nCosts: [1 1 1 1; 2 2 2 2; 3 3 3 3; 0 0 0 0]\nDemand: [100, 100, 100, 100]\nSupply: [100, 100, 100, 100]\n\nCost:\n600.0\nSolution:\n[-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]\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Shortest-Path","page":"Algorithms","title":"Shortest Path","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::ShortestPathProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{ShortestPathProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nDescription\n\nSolves a shortest path problem given by an object of in type ShortestPathProblem.\n\nArguments\n\nproblem::ShortestPathProblem: The problem in type of ShortestPathProblem\n\nOutput\n\nShortestPathResult: The custom data type that holds path and cost.\n\nExample\n\njulia> conns = [\n Connection(1, 2, 3),\n Connection(1, 3, 2),\n Connection(1, 4, 4),\n Connection(2, 5, 3),\n Connection(3, 5, 1),\n Connection(3, 6, 1),\n Connection(4, 6, 2),\n Connection(5, 7, 6),\n Connection(6, 7, 5),\n ];\n\njulia> solve(ShortestPathProblem(conns));\n\njulia> result.path\n3-element Vector{Connection}:\n Connection(1, 3, 2, \"x13\")\n Connection(3, 6, 1, \"x36\")\n Connection(6, 7, 5, \"x67\")\n\njulia> result.cost\n8.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Maximum-Flow","page":"Algorithms","title":"Maximum Flow","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(t::MaximumFlowProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{MaximumFlowProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nArguments\n\nproblem::MaximumFlowProblem: The problem in type of MaximumFlowProblem\n\nOutput\n\nMaximumFlowResult: The custom data type that holds path and flow.\n\nExample\n\njulia> conns = [\n Connection(1, 2, 3),\n Connection(1, 3, 2),\n Connection(1, 4, 4),\n Connection(2, 5, 3),\n Connection(3, 5, 1),\n Connection(3, 6, 1),\n Connection(4, 6, 2),\n Connection(5, 7, 6),\n Connection(6, 7, 5),\n ];\njulia> problem = MaximumFlowProblem(conns)\njulia> result = solve(problem);\n\njulia> result.path\n9-element Vector{Connection}:\n Connection(1, 2, 3.0, \"x12\")\n Connection(1, 3, 2.0, \"x13\")\n Connection(1, 4, 2.0, \"x14\")\n Connection(2, 5, 3.0, \"x25\")\n Connection(3, 5, 1.0, \"x35\")\n Connection(3, 6, 1.0, \"x36\")\n Connection(4, 6, 2.0, \"x46\")\n Connection(5, 7, 4.0, \"x57\")\n Connection(6, 7, 3.0, \"x67\")\n\njulia> result.flow\n7.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Minimum-Spanning-Tree","page":"Algorithms","title":"Minimum Spanning Tree","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(p::MstProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{MstProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::MstProblem)\n\nArguments\n\nproblem::MstProblem: The problem in type of MstProblem\n\nDescription\n\nObtains the minimum spanning tree. \n\nOutput\n\n::MstResult: A MstResult object that holds the results. \n\nExamples\n\njulia> conns = Connection[\n Connection(1, 2, 10),\n Connection(2, 3, 10),\n Connection(3, 4, 10),\n Connection(1, 4, 10)\n ]\n\n4-element Vector{Connection}:\n Connection(1, 2, 10, \"x12\")\n Connection(2, 3, 10, \"x23\")\n Connection(3, 4, 10, \"x34\")\n Connection(1, 4, 10, \"x14\")\n\n julia> result = solve(MstProblem(conns))\n MstResult(Connection[Connection(3, 4, 10, \"x34\"), Connection(1, 4, 10, \"x14\"), Connection(2, 3, 10, \"x23\")], 30.0)\n \n julia> result.distance\n 30.0\n \n julia> result.connections\n 3-element Vector{Connection}:\n Connection(3, 4, 10, \"x34\")\n Connection(1, 4, 10, \"x14\")\n Connection(2, 3, 10, \"x23\")\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#pmedian","page":"Algorithms","title":"pmedian","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.pmedian","category":"page"},{"location":"algorithms/#OperationsResearchModels.PMedian.pmedian","page":"Algorithms","title":"OperationsResearchModels.PMedian.pmedian","text":"pmedian(data, ncenters)\n\nArguments\n\ndata::Matrix: Coordinates of locations \nncenters::Int: Number of centers \n\nDescription\n\nThe function calculates Euclidean distances between all possible rows of the matrix data. ncenters locations are then selected that minimizes the total distances to the nearest rows. \n\nOutput\n\nPMedianResult: PMedianResult object. \n\nExample\n\njulia> data1 = rand(10, 2);\n\njulia> data2 = rand(10, 2) .+ 50;\n\njulia> data3 = rand(10, 2) .+ 100;\n\njulia> data = vcat(data1, data2, data3);\n\njulia> result = pmedian(data, 3);\n\njulia> result.centers\n3-element Vector{Int64}:\n 1\n 16\n 21\n\n julia> result.objective\n 11.531012240599605\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#pmedian-with-distances","page":"Algorithms","title":"pmedian with distances","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.pmedian_with_distances","category":"page"},{"location":"algorithms/#OperationsResearchModels.PMedian.pmedian_with_distances","page":"Algorithms","title":"OperationsResearchModels.PMedian.pmedian_with_distances","text":"pmedian_with_distances(distancematrix, ncenters)\n\nArguments\n\ndistancematrix::Matrix: n x n matrix of distances\nncenters::Int: Number of centers \n\nDescription\n\nncenters locations are selected that minimizes the total distances to the nearest rows. \n\nOutput\n\nPMedianResult: PMedianResult object. \n\n\n\n\n\n","category":"function"},{"location":"algorithms/#CPM-(Critical-Path-Method)","page":"Algorithms","title":"CPM (Critical Path Method)","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(problem::CpmProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{CpmProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem)\n\nArguments\n\nproblem::CpmProblem: The problem in type of CpmProblem.\n\nOutput\n\n::CpmResult: The object holds the results \n\nDescription\n\nCalculates CPM (Critical Path Method) and reports the critical path for a given set of activities. \n\nExample\n\njulia> A = CpmActivity(\"A\", 2);\njulia> B = CpmActivity(\"B\", 3);\njulia> C = CpmActivity(\"C\", 2, [A]);\njulia> D = CpmActivity(\"D\", 3, [B]);\njulia> E = CpmActivity(\"E\", 2, [B]);\njulia> F = CpmActivity(\"F\", 3, [C, D]);\njulia> G = CpmActivity(\"G\", 7, [E]);\njulia> H = CpmActivity(\"H\", 5, [E]);\njulia> I = CpmActivity(\"I\", 6, [G, F]);\njulia> J = CpmActivity(\"J\", 2, [C, D]);\n\njulia> activities = [A, B, C, D, E, F, G, H, I, J];\n\njulia> problem = CpmProblem(activities);\n\njulia> result = solve(problem);\n\njulia> result.pathstr\n4-element Vector{String}:\n \"B\"\n \"E\"\n \"G\"\n \"I\"\n\n julia> result.path == [B, E, G, I]\ntrue\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#CPM-Activity","page":"Algorithms","title":"CPM Activity","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.CpmActivity","category":"page"},{"location":"algorithms/#OperationsResearchModels.CPM.CpmActivity","page":"Algorithms","title":"OperationsResearchModels.CPM.CpmActivity","text":"CpmActivity(name::String, time::Float64, dependencies)\n\nDescription\n\nThe object that represents an activity in CPM (Critical Path Method).\n\nArguments\n\nname::String: The name of the activity.\ntime::Float64: The time of the activity.\ndependencies: The dependencies of the activity in type of Vector{CpmActivity}.\n\nExample\n\njulia> A = CpmActivity(\"A\", 2, []);\n\njulia> B = CpmActivity(\"B\", 3, []);\n\njulia> C = CpmActivity(\"C\", 2, [A, B]);\n\n\n\n\n\n\n","category":"type"},{"location":"algorithms/#PERT-(Project-Evalutation-and-Review-Technique)","page":"Algorithms","title":"PERT (Project Evalutation and Review Technique)","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(problem::PertProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{PertProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::PertProblem)::PertResult\n\nArguments\n\nproblem::PertProblem: The problem in type of PertProblem.\n\nExample\n\njulia> A = PertActivity(\"A\", 1, 2, 3)\nPertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[])\n\njulia> B = PertActivity(\"B\", 3, 3, 3)\nPertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])\n\njulia> C = PertActivity(\"C\", 5, 5, 5, [A, B])\nPertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])\n\njulia> activities = [A, B, C]\n3-element Vector{PertActivity}:\n PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[])\n PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])\n PertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])\n\njulia> problem = PertProblem(activities);\n\njulia> result = pert(activities)\nPertResult(PertActivity[PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[]), PertActivity(\"C\", 5.0, 5.0, 5.0, PertActivity[PertActivity(\"A\", 1.0, 2.0, 3.0, PertActivity[]), PertActivity(\"B\", 3.0, 3.0, 3.0, PertActivity[])])], 8.0, 0.0)\n\njulia> result.mean\n8.0\n\njulia> result.stddev\n0.0\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#PERT-Activity","page":"Algorithms","title":"PERT Activity","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.PertActivity","category":"page"},{"location":"algorithms/#OperationsResearchModels.CPM.PertActivity","page":"Algorithms","title":"OperationsResearchModels.CPM.PertActivity","text":"PertActivity(name::String, o::Float64, m::Float64, p::Float64)::PertActivity\n\nDescription\n\nThe object that represents an activity in PERT (Program Evaluation and Review Technique).\n\nArguments\n\nname::String: The name of the activity.\no::Float64: The optimistic time of the activity.\nm::Float64: The most likely time of the activity.\np::Float64: The pessimistic time of the activity.\ndependencies: The dependencies of the activity in type of Vector{PertActivity}.\n\nExample\n\njulia> A = PertActivity(\"A\", 1, 2, 3);\njulia> B = PertActivity(\"B\", 3, 3, 4);\njulia> C = PertActivity(\"C\", 5, 6, 7, [A, B]);\n\n\n\n\n\n","category":"type"},{"location":"algorithms/#Knapsack","page":"Algorithms","title":"Knapsack","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.solve(p::KnapsackProblem)","category":"page"},{"location":"algorithms/#OperationsResearchModels.solve-Tuple{KnapsackProblem}","page":"Algorithms","title":"OperationsResearchModels.solve","text":"solve(problem::KnapsackProblem)::KnapsackResult\n\nDescription\n\nSolves the knapsack problem.\n\nArguments\n\nproblem::KnapsackProblem: The problem in type of KnapsackProblem.\n\nOutput\n\nKnapsackResult: The custom data type that holds selected items, model, and objective value.\n\nExample\n\njulia> values = [10, 20, 30, 40, 50];\njulia> weights = [1, 2, 3, 4, 5];\njulia> capacity = 10;\njulia> solve(KnapsackProblem(values, weights, capacity));\n\n\n\n\n\n","category":"method"},{"location":"algorithms/#Johnson's-Rule","page":"Algorithms","title":"Johnson's Rule","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.johnsons","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.johnsons","page":"Algorithms","title":"OperationsResearchModels.Johnsons.johnsons","text":"johnsons(times::Matrix)\n\nGiven a matrix of times, returns a JohnsonResult with the permutation of the jobs. If number of machines is 2, it uses the Johnson's algorithm for 2 machines. If number of machines is greater than 2, it uses the Johnson's algorithm by transforming the problem into a 2-machine problem. In order to reduce the original problem to a 2-machine problem, the algorithm checks if the minimum time of the first machine is greater or equal than the maximum time of the other machines and/or if the minimum time of the last machine is greater or equal than the maximum time of the other machines.\n\nFor example if we have 4 machines, namely, A, B, C, and D at least one of the following conditions must be satisfied:\n\nmin(A) >= max(B, C)\nmin(D) >= max(B, C)\n\nThe function throws a JohnsonException if the problem cannot be reduced to a 2-machine problem.\n\nArguments\n\ntimes::Matrix: a matrix of times\n\nReturns\n\nJohnsonResult: a custom data type that holds the permutation of the jobs\n\nExample\n\ntimes = Float64[\n 3.1 2.8;\n 4.0 7.0;\n 8.0 3.0;\n 5.0 8.0;\n 6.0 4.0;\n 8.0 5.0;\n 7.0 4.0\n]\n\nresult = johnsons(times)\n\nprintln(result.permutation)\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Genetic-Algorithm-for-the-problems-that-cannot-be-solved-with-using-Johnson's-Rule","page":"Algorithms","title":"Genetic Algorithm for the problems that cannot be solved with using Johnson's Rule","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.johnsons_ga","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.johnsons_ga","page":"Algorithms","title":"OperationsResearchModels.Johnsons.johnsons_ga","text":"johnsons_ga(times::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::JohnsonResult\n\nGiven a matrix of times, returns a JohnsonResult with the permutation of the jobs. The function uses a genetic algorithm to find the best permutation of the jobs. The genetic algorithm is implemented in the RandomKeyGA module.\n\nArguments\n\ntimes::Matrix: a matrix of times\npopsize::Int: the population size. Default is 100\nngen::Int: the number of generations. Default is 1000\npcross::Float64: the crossover probability. Default is 0.8\npmutate::Float64: the mutation probability. Default is 0.01\nnelites::Int: the number of elites. Default is 1\n\nReturns\n\nJohnsonResult: a custom data type that holds the permutation of the jobs\n\nExample\n\ntimes = Float64[\n 3.1 2.8;\n 4.0 7.0;\n 8.0 3.0;\n 5.0 8.0;\n 6.0 4.0;\n 8.0 5.0;\n 7.0 4.0\n]\n\nresult = johnsons(times)\n\nprintln(result.permutation)\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Makespan","page":"Algorithms","title":"Makespan","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.makespan","category":"page"},{"location":"algorithms/#OperationsResearchModels.Johnsons.makespan","page":"Algorithms","title":"OperationsResearchModels.Johnsons.makespan","text":"makespan(times::Matrix, permutation::Vector{Int})\n\nGiven a matrix of times and a permutation of the jobs, returns the makespan of the jobs.\n\nArguments\n\ntimes::Matrix: a matrix of times\npermutation::Vector{Int}: a permutation of the jobs\n\nReturns\n\nFloat64: the makespan of the jobs\n\nExample\n\n\njulia> times = Float64[\n 3 3 5;\n 8 4 8;\n 7 2 10;\n 5 1 7;\n 2 5 6 \n]\n\njulia> result = makespan(times, [1, 4, 5, 3, 2])\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Traveling-Salesman","page":"Algorithms","title":"Traveling Salesman","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.travelingsalesman","category":"page"},{"location":"algorithms/#OperationsResearchModels.TravelingSalesman.travelingsalesman","page":"Algorithms","title":"OperationsResearchModels.TravelingSalesman.travelingsalesman","text":"travelingsalesman(distancematrix::Matrix; popsize = 100, ngen = 1000, pcross = 0.8, pmutate = 0.01, nelites = 1)::TravelinSalesmenResult\n\nGiven a matrix of distances, returns a TravelinSalesmenResult with the best route and its cost.\n\nArguments\n\ndistancematrix::Matrix: a matrix of distances\npopsize::Int: the population size. Default is 100\nngen::Int: the number of generations. Default is 1000\npcross::Float64: the crossover probability. Default is 0.8\npmutate::Float64: the mutation probability. Default is 0.01\nnelites::Int: the number of elites. Default is 1\n\nReturns\n\nTravelinSalesmenResult: a custom data type that holds the best route and its cost\n\nExample\n\npts = Float64[\n 0 0;\n 0 1;\n 0 2;\n 1 2;\n 2 2;\n 3 2;\n 4 2; \n 5 2;\n 5 1;\n 5 0;\n 4 0;\n 3 0;\n 2 0;\n 1 0;\n]\n\nn = size(pts, 1\ndistmat = zeros(n, n)\n\nfor i in 1:n\n for j in 1:n\n distmat[i, j] = sqrt(sum((pts[i, :] .- pts[j, :]).^2))\n end \nend\n\nresult = travelingsalesman(distmat, ngen = 1000, popsize = 100, pcross = 1.0, pmutate = 0.10)\n\n\n\n\n\n","category":"function"},{"location":"algorithms/#Simplex","page":"Algorithms","title":"Simplex","text":"","category":"section"},{"location":"algorithms/","page":"Algorithms","title":"Algorithms","text":"OperationsResearchModels.createsimplexproblem","category":"page"},{"location":"algorithms/#OperationsResearchModels.Simplex.createsimplexproblem","page":"Algorithms","title":"OperationsResearchModels.Simplex.createsimplexproblem","text":"createsimplexproblem(obj::Vector, amat::Matrix, rhs::Vector, dir::Vector, opttype::OptimizationType)::SimplexProblem\n\nDescription:\n\nThis function creates a SimplexProblem object from the given parameters.\n\nArguments:\n\nobj::Vector: The objective function coefficients.\namat::Matrix: The LHS of the constraints.\nrhs::Vector: The RHS of the constraints.\ndir::Vector: The directions of the constraints. Can be a vector of LE (<=), GE (>=), or EQ (==).\nopttype::OptimizationType: The type of the optimization. Can be Maximize or Minimize.\n\nReturns:\n\nA SimplexProblem object.\n\nExample:\n\nSuppose the linear programming problem is as follows:\n\nMaximize: 1.0x1 + 2.0x2 + 3.0x3\nSubject to:\n1.0x1 + 2.0x2 + 3.0x3 <= 10.0\n3.0x1 + 1.0x2 + 5.0x3 <= 15.0\nx1, x2 >= 0\n\nThe following code creates a SimplexProblem object for the above problem:\n\nusing OperationsResearch.Simplex\n\nobj = Float64[1.0, 2.0, 3.0]\namat = Float64[1.0 2.0 3.0; 3.0 1.0 5.0]\nrhs = Float64[10.0, 15.0]\ndir = [LE, LE]\nopttype = Maximize\n\ns = createsimplexproblem(obj, amat, rhs, dir, opttype)\niters = simplexiterations(s)\n\n\n\n\n\n","category":"function"}] }