Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set
// doxy/ or-tools/ src/ algorithms/

operations_research::HungarianOptimizer Class Reference

List of all members.

Public Member Functions

 HungarianOptimizer (const std::vector< std::vector< double > > &costs)
 Setup the initial conditions for the algorithm.
void Maximize (std::vector< int > *agent, std::vector< int > *task)
 Find an assignment which maximizes the total cost.
void Minimize (std::vector< int > *agent, std::vector< int > *task)
 Find an assignment which minimizes the total cost.


Detailed Description

Definition at line 24 of file hungarian.cc.


Constructor & Destructor Documentation

operations_research::HungarianOptimizer::HungarianOptimizer ( const std::vector< std::vector< double > > &  costs  )  [explicit]

Setup the initial conditions for the algorithm.

Parameters: costs is a matrix of the cost of assigning each agent to each task. costs[i][j] is the cost of assigning agent i to task j. All the costs must be non-negative. This matrix does not have to be square (i.e. we can have different numbers of agents and tasks), but it must be regular (i.e. there must be the same number of entries in each row of the matrix).

Definition at line 231 of file hungarian.cc.


Member Function Documentation

void operations_research::HungarianOptimizer::Maximize ( std::vector< int > *  preimage,
std::vector< int > *  image 
)

Find an assignment which maximizes the total cost.

Returns the assignment in the two vectors passed as argument. agent[i] is assigned to task[i].

Return an array of pairs of integers. Each pair (i, j) corresponds to assigning agent i to task j.

Definition at line 298 of file hungarian.cc.

void operations_research::HungarianOptimizer::Minimize ( std::vector< int > *  preimage,
std::vector< int > *  image 
)

Find an assignment which minimizes the total cost.

Returns the assignment in the two vectors passed as argument. agent[i] is assigned to task[i].

Return an array of pairs of integers. Each pair (i, j) corresponds to assigning agent i to task j.

Definition at line 313 of file hungarian.cc.


The documentation for this class was generated from the following file: