PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
initial_solution.h
Go to the documentation of this file.
1 /*PGR-GNU*****************************************************************
2 
3 FILE: initial_solution.h
4 
5 Copyright (c) 2015 pgRouting developers
6 Mail: project@pgrouting.org
7 
8 ------
9 
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14 
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 
24  ********************************************************************PGR-GNU*/
25 
26 #pragma once
27 
28 #include <set>
29 #include <deque>
30 #include "./solution.h"
31 
32 namespace pgrouting {
33 namespace vrp {
34 
35 
36 class Pgr_pickDeliver;
37 
38 
39 class Initial_solution : public Solution {
40  public:
42  int kind,
43  const Pgr_pickDeliver *problem);
44 
45  void invariant() const;
46 
47  private:
48  /*
49  * one truck per order
50  */
51  void one_truck_per_order();
52  void one_truck_all_orders();
55  void insert_while_feasable();
56 
59  Vehicle_pickDeliver &truck,
60  std::set<size_t> &possible_orders);
61  std::deque<size_t> first_ordersIJ() const;
62 
65  Vehicle_pickDeliver &truck,
66  std::set<size_t> &possible_orders);
67  std::deque<size_t> first_ordersJI() const;
68 
69 
70  private:
71  std::set<size_t> all_orders;
72  std::set<size_t> unassigned;
73  std::set<size_t> assigned;
74 };
75 
76 } // namespace vrp
77 } // namespace pgRouting
void fill_truck_while_compatibleI(Vehicle_pickDeliver &truck, std::set< size_t > &possible_orders)
const Pgr_pickDeliver * problem
Definition: solution.h:49
PGDLLEXPORT Datum vrp(PG_FUNCTION_ARGS)
Definition: VRP.c:732
Initial_solution(int kind, const Pgr_pickDeliver *problem)
std::deque< size_t > first_ordersJI() const
std::deque< size_t > first_ordersIJ() const
void fill_truck_while_compatibleJ(Vehicle_pickDeliver &truck, std::set< size_t > &possible_orders)