Dynamics¶
Dynamics (base class)¶
Dynamics
¶
Bases: ABC
Base class for solver dynamics that control agent-solver interaction.
Subclasses must implement :meth:reset, :meth:step, and :meth:close.
Source code in gyozas/dynamics/dynamics.py
BranchingDynamics¶
BranchingDynamics
¶
Bases: ThreadedDynamics
Dynamics for variable branching decisions in the branch-and-bound solver.
At each step, the agent selects which fractional variable to branch on. The action set contains variable indices from SCIP's LP branching candidates.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
with_extra_actions
|
list[int] | list[ExtraBranchingActions] | list[int | ExtraBranchingActions] | None
|
Optional list of extra action IDs (e.g. |
None
|
Source code in gyozas/dynamics/branching.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
NodeSelectionDynamics¶
NodeSelectionDynamics
¶
Bases: ThreadedDynamics
Dynamics for node selection decisions in the branch-and-bound solver.
At each step, the agent selects which open node to explore next. The action set contains node IDs (leaves, children, and siblings).
Source code in gyozas/dynamics/node_selection.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | |
ConfiguringDynamics¶
ConfiguringDynamics
¶
Bases: Dynamics
Dynamics for algorithm configuration: set SCIP parameters then solve.
Inspired by ecole.dynamics.ConfiguringDynamics.
The episode has a single step:
1. reset(model) returns (False, None) — the agent may now choose params.
2. step(param_dict) sets each {name: value} pair on the model, calls
model.optimize(), and returns (True, None).
The action is a dict[str, Any] mapping SCIP parameter names to values,
e.g. {"limits/time": 60.0, "lp/threads": 4}.
The action set is always None (unconstrained).
Source code in gyozas/dynamics/configuring.py
step(action)
¶
Set SCIP parameters from action and solve the instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
dict
|
Mapping of SCIP parameter names to values. Pass an empty dict to solve with default parameters. |
required |
Source code in gyozas/dynamics/configuring.py
PrimalSearchDynamics¶
PrimalSearchDynamics
¶
Bases: ThreadedDynamics
Dynamics for primal solution search in the branch-and-bound solver.
Inspired by ecole.dynamics.PrimalSearchDynamics. At each step the agent
provides a partial assignment (var_indices, vals) over the current
pseudo-branching candidates. The dynamics tries to complete it into a feasible
solution via LP probing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trials_per_node
|
int
|
Number of agent interactions (probing trials) per heuristic call. -1 means unlimited (run until SCIP stops the solve). |
1
|
depth_freq
|
int
|
Heuristic frequency: called every |
1
|
depth_start
|
int
|
Minimum depth at which the heuristic is called. |
0
|
depth_stop
|
int
|
Maximum depth at which the heuristic is called (-1 = no limit). |
-1
|
Source code in gyozas/dynamics/primal_search.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | |
step(action)
¶
Apply a partial assignment and advance the solve.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
action
|
tuple[NDArray[int64], NDArray[float64]]
|
|
required |