> For the complete documentation index, see [llms.txt](https://docs.finch3d.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.finch3d.com/docs/projects-and-variants/story-editor/algorithm-theory.md).

# Algorithm Theory

## How does the custom core algorithm work?

* The custom core algorithm looks at the shape of your corridor, and tries to find natural connecting lines to the facade walls of your building. It also checks to make sure that each apartment has access to a corridor within your circulation core, and is not only connecting to the elevator or stairs.
* The algorithm will try to hit the unit sizes and ratio you have requested through out the whole building. There will usually be one apartment "left over/ sacrificed" that is too big or too small, due to the mathematical division of areas. It is up to you as the architect to further edit and refine.

<figure><img src="/files/S25SL3D72Blz91PHRDwa" alt=""><figcaption></figcaption></figure>

## How does the blank slate (beta) algorithm work?

* The generate stairwells from scratch algorithm divides your building up into "buckets" of stairwells and apartments. If you request 3 stairwells, you will have 3 buckets.
* Within each of these buckets, the algorithm will try to hit the unit sizes and ratio that you have requested.

<div data-full-width="false"><figure><img src="/files/vlZGv4vS6Zex5BPJkQHw" alt=""><figcaption></figcaption></figure></div>

## How do the weights / scoring work?

Each iteration is scored for how well it hits certain metrics after inputting "non-negotiable" variables.

Non-negotiables are requirements applied right out of the gate before the scoring takes affect, such as circulation entrance access, minimum width, and stairwell count.

After hitting the non-negotiables, the user can then influence the direction that the algorithm iterates. By changing the weights, the user can tell the algorithm what is important and what is less so. This process can be described as making trade-offs.

For example, if you would like to hit the unit sizes exactly, you can increase that weight, but that may result in a less accurate ratio or slightly worse daylight access.

{% hint style="info" %}
**`Iteration A`**\
Scoring with Unit Size prioritized

Unit size score = 4 (x3 multiplier due to weights)\
Daylight score = 4

Ratio score = 3\
**Total score = 19**

**`Iteration B`**

Scoring with equal priortization

Unit size score = 3\
Daylight score = 6

Ratio score = 5\
**Total score = 13**

**`Iteration A would be selected due to the priority multiplier.`**
{% endhint %}

Moving all weights to the highest priority is the same as having them all at the lowest- they will be scored equally.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.finch3d.com/docs/projects-and-variants/story-editor/algorithm-theory.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
