dfsPackGrid2
dfsPackGrid2<
T>(items,columnCount,options):GridPackResult<T>
Defined in: grid-pack-dfs.ts:73
Packs items into a W-column grid using depth-first search with
backtracking.
Items are placed in reading order (left-to-right, top-to-bottom) starting at
the first empty cell. The caller controls candidate ordering through the
classify weight function. When the node budget is exceeded, the algorithm
preserves state at the deepest reached point, drills a hole to fill the
remainder of the frontier row, and restarts the DFS from the next row.
Items not placed by the DFS are absent from result.place. The caller is
responsible for placing them (tail placement) using result.grid.
Type Parameters
Section titled “Type Parameters”T extends GridPackItem
Parameters
Section titled “Parameters”T[]
columnCount
Section titled “columnCount”number