diff --git a/include/starobservationschedulingsolver/flexible_star_observation_scheduling/algorithms/column_generation.hpp b/include/starobservationschedulingsolver/flexible_star_observation_scheduling/algorithms/column_generation.hpp index 4a68f9f..97676a9 100644 --- a/include/starobservationschedulingsolver/flexible_star_observation_scheduling/algorithms/column_generation.hpp +++ b/include/starobservationschedulingsolver/flexible_star_observation_scheduling/algorithms/column_generation.hpp @@ -1,37 +1,3 @@ -/** - * Dantzig-Wolfe decomposition. - * - * The linear programming formulation of the problem based on Dantzig–Wolfe - * decomposition is written as follows: - * - * Variables: - * - yᵢᵏ ∈ {0, 1} representing a feasible schedule of night i. - * yᵢᵏ = 1 iff the corresponding schedule is selected for night i. - * xⱼᵢᵏ = 1 iff yᵢᵏ contains target j, otherwise 0. - * - * Program: - * - * max ∑ᵢ ∑ₖ (∑ⱼ wⱼ xⱼᵢᵏ) yᵢᵏ - * Note that (∑ⱼ wⱼ xⱼᵢᵏ) is a constant. - * - * 0 <= ∑ₖ yᵢᵏ <= 1 for all nights i - * (not more than 1 schedule selected for each night) - * Dual variables: uᵢ - * 0 <= ∑ₖ xⱼᵢᵏ yᵢᵏ <= 1 for all targets j - * (each target selected at most once) - * Dual variables: vⱼ - * - * The pricing problem consists in finding a variable of positive reduced cost. - * The reduced cost of a variable yᵢᵏ is given by: - * rc(yᵢᵏ) = ∑ⱼ wⱼ xⱼᵢᵏ - uᵢ - ∑ⱼ xⱼᵢᵏ vⱼ - * = ∑ⱼ (wⱼ - vⱼ) xⱼᵢᵏ - uᵢ - * - * Therefore, finding a variable of maximum reduced cost reduces to solving m - * Single Night Star Observation Scheduling Problems with targets with profit - * (wⱼ - vⱼ). - * - */ - #pragma once #include "starobservationschedulingsolver/flexible_star_observation_scheduling/solution.hpp" diff --git a/include/starobservationschedulingsolver/star_observation_scheduling/algorithms/column_generation.hpp b/include/starobservationschedulingsolver/star_observation_scheduling/algorithms/column_generation.hpp index 8d02172..b4cf46c 100644 --- a/include/starobservationschedulingsolver/star_observation_scheduling/algorithms/column_generation.hpp +++ b/include/starobservationschedulingsolver/star_observation_scheduling/algorithms/column_generation.hpp @@ -1,40 +1,3 @@ -/** - * Star observation scheduling problem - * - * Problem description: - * See https://github.com/fontanf/orproblems/blob/main/orproblems/starobservationscheduling.hpp - * - * The linear programming formulation of the problem based on Dantzig–Wolfe - * decomposition is written as follows: - * - * Variables: - * - yᵢᵏ ∈ {0, 1} representing a feasible schedule of night i. - * yᵢᵏ = 1 iff the corresponding schedule is selected for night i. - * xⱼᵢᵏ = 1 iff yᵢᵏ contains target j, otherwise 0. - * - * Program: - * - * max ∑ᵢ ∑ₖ (∑ⱼ wⱼ xⱼᵢᵏ) yᵢᵏ - * Note that (∑ⱼ wⱼ xⱼᵢᵏ) is a constant. - * - * 0 <= ∑ₖ yᵢᵏ <= 1 for all nights i - * (not more than 1 schedule selected for each night) - * Dual variables: uᵢ - * 0 <= ∑ₖ xⱼᵢᵏ yᵢᵏ <= 1 for all targets j - * (each target selected at most once) - * Dual variables: vⱼ - * - * The pricing problem consists in finding a variable of positive reduced cost. - * The reduced cost of a variable yᵢᵏ is given by: - * rc(yᵢᵏ) = ∑ⱼ wⱼ xⱼᵢᵏ - uᵢ - ∑ⱼ xⱼᵢᵏ vⱼ - * = ∑ⱼ (wⱼ - vⱼ) xⱼᵢᵏ - uᵢ - * - * Therefore, finding a variable of maximum reduced cost reduces to solving m - * Single Night Star Observation Scheduling Problems with targets with profit - * (wⱼ - vⱼ). - * - */ - #pragma once #include "starobservationschedulingsolver/star_observation_scheduling/solution.hpp" diff --git a/src/flexible_star_observation_scheduling/algorithms/column_generation.cpp b/src/flexible_star_observation_scheduling/algorithms/column_generation.cpp index 65e3c85..3deab58 100644 --- a/src/flexible_star_observation_scheduling/algorithms/column_generation.cpp +++ b/src/flexible_star_observation_scheduling/algorithms/column_generation.cpp @@ -1,3 +1,37 @@ +/** + * Dantzig-Wolfe decomposition. + * + * The linear programming formulation of the problem based on Dantzig–Wolfe + * decomposition is written as follows: + * + * Variables: + * - yᵢᵏ ∈ {0, 1} representing a feasible schedule of night i. + * yᵢᵏ = 1 iff the corresponding schedule is selected for night i. + * xⱼᵢᵏ = 1 iff yᵢᵏ contains target j, otherwise 0. + * + * Program: + * + * max ∑ᵢ ∑ₖ (∑ⱼ wⱼ xⱼᵢᵏ) yᵢᵏ + * Note that (∑ⱼ wⱼ xⱼᵢᵏ) is a constant. + * + * 0 <= ∑ₖ yᵢᵏ <= 1 for all nights i + * (not more than 1 schedule selected for each night) + * Dual variables: uᵢ + * 0 <= ∑ₖ xⱼᵢᵏ yᵢᵏ <= 1 for all targets j + * (each target selected at most once) + * Dual variables: vⱼ + * + * The pricing problem consists in finding a variable of positive reduced cost. + * The reduced cost of a variable yᵢᵏ is given by: + * rc(yᵢᵏ) = ∑ⱼ wⱼ xⱼᵢᵏ - uᵢ - ∑ⱼ xⱼᵢᵏ vⱼ + * = ∑ⱼ (wⱼ - vⱼ) xⱼᵢᵏ - uᵢ + * + * Therefore, finding a variable of maximum reduced cost reduces to solving m + * Single Night Star Observation Scheduling Problems with targets with profit + * (wⱼ - vⱼ). + * + */ + #include "starobservationschedulingsolver/flexible_star_observation_scheduling/algorithms/column_generation.hpp" #include "starobservationschedulingsolver/flexible_star_observation_scheduling/algorithm_formatter.hpp" diff --git a/src/star_observation_scheduling/algorithms/column_generation.cpp b/src/star_observation_scheduling/algorithms/column_generation.cpp index 06fcf0f..8699ff4 100644 --- a/src/star_observation_scheduling/algorithms/column_generation.cpp +++ b/src/star_observation_scheduling/algorithms/column_generation.cpp @@ -1,3 +1,40 @@ +/** + * Star observation scheduling problem + * + * Problem description: + * See https://github.com/fontanf/orproblems/blob/main/orproblems/starobservationscheduling.hpp + * + * The linear programming formulation of the problem based on Dantzig–Wolfe + * decomposition is written as follows: + * + * Variables: + * - yᵢᵏ ∈ {0, 1} representing a feasible schedule of night i. + * yᵢᵏ = 1 iff the corresponding schedule is selected for night i. + * xⱼᵢᵏ = 1 iff yᵢᵏ contains target j, otherwise 0. + * + * Program: + * + * max ∑ᵢ ∑ₖ (∑ⱼ wⱼ xⱼᵢᵏ) yᵢᵏ + * Note that (∑ⱼ wⱼ xⱼᵢᵏ) is a constant. + * + * 0 <= ∑ₖ yᵢᵏ <= 1 for all nights i + * (not more than 1 schedule selected for each night) + * Dual variables: uᵢ + * 0 <= ∑ₖ xⱼᵢᵏ yᵢᵏ <= 1 for all targets j + * (each target selected at most once) + * Dual variables: vⱼ + * + * The pricing problem consists in finding a variable of positive reduced cost. + * The reduced cost of a variable yᵢᵏ is given by: + * rc(yᵢᵏ) = ∑ⱼ wⱼ xⱼᵢᵏ - uᵢ - ∑ⱼ xⱼᵢᵏ vⱼ + * = ∑ⱼ (wⱼ - vⱼ) xⱼᵢᵏ - uᵢ + * + * Therefore, finding a variable of maximum reduced cost reduces to solving m + * Single Night Star Observation Scheduling Problems with targets with profit + * (wⱼ - vⱼ). + * + */ + #include "starobservationschedulingsolver/star_observation_scheduling/algorithms/column_generation.hpp" #include "starobservationschedulingsolver/star_observation_scheduling/algorithm_formatter.hpp"