Class GreedySolution¶
- Defined in File greedy.hpp
Inheritance Relationships¶
Base Type¶
public Solution
(Class Solution)
Class Documentation¶
-
class
GreedySolution
: public Solution¶ Public Functions
-
GreedySolution
(const std::vector<Node> &nodes, const std::vector<Vehicle> &vehicles, const std::vector<std::vector<double>> &distanceMatrix)¶ Constructor.
Constructor for initial setup of problem, and solution using greedy algorithm
- Return
- No return parameter
- Parameters
nodes
: Vector of nodesvehicles
: Vector of vehiclesdistanceMatrix
: Matrix containing distance between each pair of nodes
-
GreedySolution
(const Problem &p)¶ Constructor.
Constructor for initial setup of problem, and solution using greedy algorithm
- Return
- No return parameter
- Parameters
p
: Instance of Problem class defining the problem parameters
-
void
Solve
()¶ Function called to solve the given problem using a greedy algorithm.
Generates random iniitial solutions. Applies selected algorithm. Prints cost of best solution, and its validity.
- Return
- void
-