|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Classes | |
| struct | Move |
Public Types | |
| using | State = KnapsackState |
| using | Objective = double |
Public Member Functions | |
| KnapsackDomain (const Array< Item > &items, double capacity) | |
| bool | is_complete (const State &s) const noexcept |
| True when all items have been decided. | |
| Objective | objective_value (const State &s) const noexcept |
| Objective value for a complete assignment. | |
| Objective | bound (const State &s) const noexcept |
| Greedy fractional upper bound on the remaining items. | |
| void | apply (State &s, const Move &m) const noexcept |
| void | undo (State &s, const Move &m) const noexcept |
| bool | is_feasible (const State &s) const noexcept |
| template<typename Visitor > | |
| bool | for_each_successor (const State &s, Visitor visit) const |
Private Attributes | |
| Array< Item > | items_ |
| double | capacity_ |
Definition at line 82 of file branch_and_bound_df_vs_bf_example.cc.
Definition at line 91 of file branch_and_bound_df_vs_bf_example.cc.
Definition at line 90 of file branch_and_bound_df_vs_bf_example.cc.
Definition at line 93 of file branch_and_bound_df_vs_bf_example.cc.
References Aleph::divide_and_conquer_partition_dp(), items_, and Aleph::Array< T >::size().
Definition at line 150 of file branch_and_bound_df_vs_bf_example.cc.
References items_, m, Item::value, and Item::weight.
Greedy fractional upper bound on the remaining items.
Takes remaining items in value-density order and fills the remaining capacity fractionally. This is an admissible upper bound for B&B.
Definition at line 126 of file branch_and_bound_df_vs_bf_example.cc.
References Aleph::and, capacity_, Aleph::divide_and_conquer_partition_dp(), items_, Aleph::Array< T >::size(), Item::value, and Item::weight.
Definition at line 178 of file branch_and_bound_df_vs_bf_example.cc.
References capacity_, Aleph::divide_and_conquer_partition_dp(), items_, KnapsackState::next_item, Aleph::Array< T >::size(), Item::weight, and KnapsackState::weight_so_far.
True when all items have been decided.
Definition at line 110 of file branch_and_bound_df_vs_bf_example.cc.
References items_, and Aleph::Array< T >::size().
Definition at line 172 of file branch_and_bound_df_vs_bf_example.cc.
References capacity_.
Objective value for a complete assignment.
Definition at line 116 of file branch_and_bound_df_vs_bf_example.cc.
Definition at line 161 of file branch_and_bound_df_vs_bf_example.cc.
References items_, m, Item::value, and Item::weight.
|
private |
Definition at line 196 of file branch_and_bound_df_vs_bf_example.cc.
Referenced by bound(), for_each_successor(), and is_feasible().
Definition at line 195 of file branch_and_bound_df_vs_bf_example.cc.
Referenced by KnapsackDomain(), apply(), bound(), for_each_successor(), is_complete(), and undo().