/**
 * Pre-allocated scratch reused by every recursive `bisect_graph` call during
 * the initial-partition phase.
 *
 * Recursive bisection produces O(k) subgraphs that each need their own
 * refinement state and FM scratch — but only at sizes <= the coarsest vertex
 * count. Sharing one set of arrays scoped to that maximum eliminates O(k)
 * typed-array allocations and the corresponding GC pressure.
 *
 * Contents:
 *
 *   - **Compute-2way state**: `boundary_vertices`, `boundary_position_of_vertex`,
 *     `internal_degree`, `external_degree`, `partition_weights[2]`.
 *
 *   - **FM-2way state**: `fm_heaps` (one per side of the bisection),
 *     `fm_moved_pass_index`, `fm_swap_history`, `fm_insertion_order`.
 *
 *   - **Bisect snapshot**: `best_partition_snapshot` for grow+FM trial selection.
 *
 *   - **`vertex_partition_pool`**: a stack of vertex_partition arrays. Each
 *     recursive call takes a slot (via `take_vertex_partition_slot`) and
 *     releases it on return. New slots are allocated lazily, capped at
 *     `log2(k)` total — the maximum recursion depth.
 *
 * The two FM heaps are sized to `max_vertex_count` at construction. Their
 * internal `__slot_of_id` table can hold any id in `[0, max_vertex_count)`, so
 * subgraphs of any size below that work without expanding. `clear()` resets
 * heap state in O(size), not O(capacity).
 *
 * `fm_moved_pass_index` starts initialised to -1. fm_2way's per-pass cleanup
 * resets touched entries back to -1, so the invariant is preserved across
 * calls — no need to refill the whole array between bisect_graph invocations.
 */
export class BisectionScratch {
    /**
     * @param {number} max_vertex_count typically the coarsest graph's vertex count
     */
    constructor(max_vertex_count: number);
    max_vertex_count: number;
    boundary_vertices: Uint32Array;
    boundary_position_of_vertex: Int32Array;
    internal_degree: Uint32Array;
    external_degree: Uint32Array;
    partition_weights: Uint32Array;
    best_partition_snapshot: Uint32Array;
    fm_heaps: IndexedFloatMaxHeap[];
    fm_moved_pass_index: Int32Array;
    fm_swap_history: Uint32Array;
    fm_insertion_order: Uint32Array;
    /** @type {Uint32Array[]} */
    vertex_partition_pool: Uint32Array[];
    vertex_partition_pool_top: number;
    /**
     * Borrow a vertex_partition slot from the pool. The first `vertex_count`
     * entries are zero-filled; values past `vertex_count` may hold stale data
     * from a sibling subgraph and must not be read.
     *
     * Returned slot remains owned by the scratch; release with
     * `release_vertex_partition_slot` once you're done with it.
     *
     * @param {number} vertex_count subgraph's vertex_count
     * @returns {Uint32Array}
     */
    take_vertex_partition_slot(vertex_count: number): Uint32Array;
    /**
     * Pop the top vertex_partition slot off the pool. Pairs with
     * `take_vertex_partition_slot` — call exactly once per take.
     */
    release_vertex_partition_slot(): void;
}
import { IndexedFloatMaxHeap } from "../refine/IndexedFloatMaxHeap.js";
//# sourceMappingURL=BisectionScratch.d.ts.map