> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Tree of hypotheses

> Understand the tree of hypotheses in ABBYY FlexiLayout Studio: how the best path is chosen, how to view it in the Hypotheses window, and what icons mean.

When matching each layout alternative with an image, the program successively generates hypotheses for each of the elements. Hypotheses for the elements are generated one by one: from the first (topmost) element in the tree to the last (bottom) element. From the generated hypotheses, a tree of hypotheses is built.

If the layout alternative is successfully matched with the image, the tree of hypotheses is displayed in the **Hypotheses** window. If more than one layout alternative matches the image, the tree of hypotheses for the first alternative is displayed. If none of the alternatives can match the image, the tree of hypotheses for the first alternative is displayed.

<Note>
  The number of hypotheses created for an element may exceed the number set in the **Number of surviving hypotheses** field. In this case, only the user-defined number of the best hypotheses will make it into the tree of hypotheses.
</Note>

## Best path

In the tree of hypotheses, the program will then look for the *best path*, that is, the best-quality path to the hypotheses of the last element. The quality of the path is calculated by multiplying the qualities of the hypotheses for the elements in this path.

The hypotheses in the best path are used to detect the blocks.

## View the tree of hypotheses

The tree of hypotheses is displayed in the [Hypotheses](/flexi-capture/fls/dif/hypotheses-window) window.

<Steps>
  <Step title="Open the image" />

  <Step title="Match the FlexiLayout with the image">
    Select **Match** from the **FlexiLayout** menu or from the shortcut menu.
  </Step>
</Steps>

To view the hypotheses for elements which are part of a Group element, select the hypothesis for the **Group** element, and then press **Enter** or select the **Show Details** command from the shortcut menu.

To go one level up, press **Ctrl+Enter** or select the **Go One Level Up** command from the shortcut menu.

<Note>
  The tree of hypotheses built for the current image is deleted when you close that image. The best path (the chain of hypotheses that was used to build the **Matched Layout**) is preserved. You can view these hypotheses when you open the image again. The program does not store the entire tree of hypotheses, because it may take up too much memory.
</Note>

## Parts of the tree of hypotheses

The left-hand column contains the elements of the first nesting level in the order in which they appear in the FlexiLayout tree.

The right-hand column contains hypotheses generated for each of the elements. Each hypothesis is marked with an icon. The hypotheses are joined by thin lines which show the order in which they were generated. The hypotheses in the best path are joined by green lines; other hypotheses are joined by gray lines.

| Icon                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Description                                                                                                                                                                      |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_best.gif?s=eef1d527150e4c2f5739a72cfbd7ffd5" alt="Best-path hypothesis icon" width="15" height="16" data-path="images/flexi-capture/fls/hyp_best.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | A hypothesis from the best path.                                                                                                                                                 |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_nobest.gif?s=fad5a1a8b8bdd896e6c606644b3a997a" alt="Hypothesis icon for a hypothesis not from the best path" width="15" height="16" data-path="images/flexi-capture/fls/hyp_nobest.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | A hypothesis not from the best path.                                                                                                                                             |
| <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_best.gif?s=9db2c734f07cf7e19d4c4278c197d329" alt="Best-path null hypothesis icon" width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_best.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     | A null hypothesis from the best path.                                                                                                                                            |
| <img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_nobest.gif?s=13279863afc14fca86342d4d5a3f995b" alt="Null hypothesis icon for a hypothesis not from the best path" width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_nobest.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | A null hypothesis not from the best path.                                                                                                                                        |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_red.gif?s=3c0dc64cbfa0e4e8cfcf92c7a0725300" alt="Incomplete hypothesis chain icon" width="15" height="16" data-path="images/flexi-capture/fls/hyp_red.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | An incomplete chain of hypotheses for a Group element (Group, Repeating Group, Header, Footer). You can view an incomplete chain of hypotheses to locate a non-detected element. |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_best+.gif?s=65b916217f9d959e54c48a7f94b26800" alt="Collapsed branch icon: best-path hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_best+.gif" />,<img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_nobest+.gif?s=09c4e67a9eec248e8bb9aa5e06311fe8" alt="Collapsed branch icon: hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_nobest+.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_best+.gif?s=c97feb2e871ce884f4c3b0a1544f88eb" alt="Collapsed branch icon: best-path null hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_best+.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_nobest+.gif?s=ae63d98f857fd255284b4b12265bf904" alt="Collapsed branch icon: null hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_nobest+.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | The branch of the element displays the hypothesis from the best path. To view all the hypotheses, press "+" or select **Expand Active** in the shortcut menu.                    |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_best-.gif?s=b69f68e3bbb81f7af79b2b271ac1f58a" alt="Expanded branch icon: best-path hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_best-.gif" />,<img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_nobest-.gif?s=aa293ae4639b06665ac2b0618331ec7b" alt="Expanded branch icon: hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_nobest-.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_best-.gif?s=a0f991b2929260c76a356ac043a32a65" alt="Expanded branch icon: best-path null hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_best-.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_nobest-.gif?s=7a6918de26d7bead52c503ec3cc6f3b9" alt="Expanded branch icon: null hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_nobest-.gif" />                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | Displays all the hypotheses in the branch of the element. To hide the hypotheses which are not from the best path, press "-" or select **Collapse Active** in the shortcut menu. |
| <img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_best_end.gif?s=7609211c2d4f1ea22f701b40693a68ea" alt="Discontinued branch icon: best-path hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_best_end.gif" />,<img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_nobest_end.gif?s=1d91bedc64567e2ae90049345ece42e8" alt="Discontinued branch icon: hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_nobest_end.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_best_end.gif?s=6d86783f67293f8bf0db92096b854515" alt="Discontinued branch icon: best-path null hypothesis" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_best_end.gif" />,<img src="https://mintcdn.com/abbyy/r-nfa7jujx5b9gKX/images/flexi-capture/fls/null_hyp_nobest_end.gif?s=3f0660dff960a679e452cb2ce4d4100e" alt="Discontinued branch icon: null hypothesis not from the best path" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/null_hyp_nobest_end.gif" />,<img src="https://mintcdn.com/abbyy/lqYknuOmCa79141v/images/flexi-capture/fls/hyp_red_striked.gif?s=b7cd00ab11c9a7b1aae6abf617119596" alt="Discontinued branch icon: incomplete hypothesis chain" style={{display:"inline-block",verticalAlign:"middle",margin:0}} width="15" height="16" data-path="images/flexi-capture/fls/hyp_red_striked.gif" /> | The sub-branch of hypotheses for the element was discontinued at this point.                                                                                                     |
