GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • OperationsResearchModels.jl
  • Bin Packing
  • Assignment
  • Transportation
  • Network
  • Project Analysis
  • Project Selection
  • Location Selection
  • Traveling Salesman
  • Scheduling
  • The Simplex Method
  • Zero-sum Games
  • Portfolio Optimization
  • GitHub

This view

  • Original page
  • New address

GeezerVison is showing jbytecode.github.io — Location Selection · OperationsResearchModels.jl

pmedian

PMedianProblemWithDistances

OperationsResearchModels.PMedian.PMedianProblemWithDistances — Type
PMedianProblemWithDistances

Fields

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

See also PMedianProblemWithCoordinates, solve(::PMedianProblemWithDistances)

source

PMedianProblemWithCoordinates

OperationsResearchModels.PMedian.PMedianProblemWithCoordinates — Type
PMedianProblemWithCoordinates

Fields

  • coordinates::Matrix: n x d matrix of coordinates
  • ncenters::Int: Number of centers

See also PMedianProblemWithDistances, solve(::PMedianProblemWithCoordinates)

source

PMedianResult

OperationsResearchModels.PMedian.PMedianResult — Type
PMedianResult

Fields

  • centers::Vector: Indices of selected centers.
  • model::JuMP.Model: JuMP model.
  • objective::Float64: Objective value.
  • z::Matrix: Binary matrix of assignments. If z[i, j] = 1 then ith point is connected to the jth point.
  • y::Vector: Binary vector. If y[i] is 1 then ith point is a depot.

See also solve(::PMedianProblemWithDistances), solve(::PMedianProblemWithCoordinates)

source

The Solver

OperationsResearchModels.solve — Method
solve(p::PMedianProblemWithDistances)

Description

The function selects ncenters locations that minimize the total distances to the nearest rows based on the provided distance matrix.

Arguments

  • p::PMedianProblemWithDistances: PMedian problem with distances.

Output

  • PMedianResult: PMedianResult object.

See also solve(::PMedianProblemWithCoordinates)

source
OperationsResearchModels.solve — Method
solve(p::PMedianProblemWithCoordinates)

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.

Arguments

  • p::PMedianProblemWithCoordinates: PMedian problem with coordinates.

Output

  • PMedianResult: PMedianResult object.

Example

data1 = rand(10, 2)

data2 = rand(10, 2) .+ 50

data3 = rand(10, 2) .+ 100

data = vcat(data1, data2, data3)

problem = PMedianProblemWithCoordinates(data, 3)

result = solve(problem)

println(result.centers)

# 3-element Vector{Int64}:
#  1
# 16
# 21

println(result.objective)
# 11.531012240599605
source
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.