What is Wave Function Collapse (WFC)?
masterWave Function Collapse (WFC) is an algorithm used to generate bitmaps (or other structures) that maintain local similarity to an input source. It ensures that the output contains only $N \times N$ patterns present in the input (Condition C1) and that the distribution of these patterns in the output is similar to their density in the input (Condition C2).
Key concepts:
- Superposition: The output starts in an 'unobserved' state where every pixel/region exists in a superposition of all possible valid states from the input.
- Observation: The algorithm selects a region with the lowest Shannon entropy and collapses it into a single definite state based on the input pattern distribution.
- Propagation: Information from a collapse is propagated to neighboring regions, reducing their possible states.
- Contradiction: If a region's possible states are reduced to zero, the algorithm has reached a contradiction and cannot continue. This is an NP-hard problem, though contradictions are rare in practice.