Reference · Rules, solvers and generation
edgeModelfunction
A layout written down as clauses (see the top of this file), or null where it cannot be solved at all: a stone its pair does not name, or a cell with too few ways in and out to hold a line.
Import it
import { edgeModel } from "@johnmorrisdotca/tsunagi";
Definition
function edgeModel(layout: LinkLayout, colours?: SatColours): EdgeModel | null
Parameters
| Name | Type | Description |
|---|---|---|
layout | LinkLayout | The decoded native board and its rule settings. |
colours (optional) | SatColours | The palette or SAT colour encoding specified by the signature. |
Returns
EdgeModel | null
The SAT edge model, or null when the layout cannot support a complete solution.
Examples
import { TSUNAGI_4 } from "@johnmorrisdotca/tsunagi/levels-4";
import { decodeLayout, edgeModel } from "@johnmorrisdotca/tsunagi";
const givens = TSUNAGI_4[0][0];
const layout = decodeLayout(givens,4)!;
console.log(edgeModel(layout)?.total);16What it prints (run when this page was built)