# Sorting

### Overview

The Quilter's recommendation (sorting) algorithm aims to assist users in quickly identifying the best boards that Quilter explored during the layout job.&#x20;

The sorting and filtering functions work together to help you efficiently find the best board that aligns with your design preferences.

Our sorting algorithms consider the following attributes for each layout candidate:

* **Completeness**, including % routing completion and # DRC violations
* **Fabrication rules,** including minimum trace width/spacing, minimum drill/via size, and minimum edge clearance
* **PRC performance,** which references PRC results for both priority and other physics constraints. The following physics constraints are considered "Priority":
  * [Power Nets](/physics-constraints/power-nets.md)
  * [Differential Pairs](/physics-constraints/differential-pairs.md)
  * [Single-ended Impedance Control](/physics-constraints/single-ended-impedance-control.md)

### Sort types

#### Recommended

Quilter's "Recommended" sort aims to help identify the most conservative stack-up and fabrication rules that maximize priority PRC completion candidates:

1. **Highest routing completion**
   1. `min` Number of DRC violations, `ASC`
   2. `max` Routing completion, `DESC`
2. **Priority PRC completion**
   1. `max` Passing Priority PRCs, `DESC`
3. **Most conservative fabrication rules**
   1. `max` Minimum trace width, `DESC`
   2. `max` Minimum trace clearance, `DESC`
   3. `max` Minimum drill size, `DESC`
   4. `max` Minimum via size, `DESC`
4. **Fewest layers**
   1. `min` Layer count, `ASC`
5. **Other PRC completion**
   1. `max` Passing Other PRCs, `DESC`
6. **Most efficient routing**
   1. `min` Shortest traces, `ASC`

#### Best PRCs

Quilter's "Best PRCs" sort prioritizes PRC completion over all other considerations except completion:

1. **Highest routing completion**
   1. `min` Number of DRC violations, `ASC`
   2. `max` Routing completion, `DESC`
2. **PRC completion**
   1. `max` Passing Priority PRCs, `DESC`
   2. `max` Passing Other PRCs, `DESC`
3. **Most conservative fabrication rules**
   1. `max` Minimum trace width, `DESC`
   2. `max` Minimum trace clearance, `DESC`
   3. `max` Minimum drill size, `DESC`
   4. `max` Minimum via size, `DESC`
4. **Fewest layers**
   1. `min` Layer count, `ASC`
5. **Most efficient routing**
   1. `min` Shortest traces, `ASC`

#### Easiest to Fab

Quilter's "Easiest to Fab" sort prioritizes conservative fabrication rules over all other considerations except completion:

1. **Highest routing completion**
   1. `min` Number of DRC violations, `ASC`
   2. `max` Routing completion, `DESC`
2. **Most conservative fabrication rules**
   1. `max` Minimum trace width, `DESC`
   2. `max` Minimum trace clearance, `DESC`
   3. `max` Minimum drill size, `DESC`
   4. `max` Minimum via size, `DESC`
3. **Fewest layers**
   1. `min` Layer count, `ASC`
4. **PRC completion**
   1. `max` Passing Priority PRCs, `DESC`
   2. `max` Passing Other PRCs, `DESC`
5. **Most efficient routing**
   1. `min` Shortest traces, `ASC`

#### Fewest Layers

Quilter's "Fewest Layers" sort prioritizes low layer counts over all other considerations except completion:

1. **Highest routing completion**
   1. `min` Number of DRC violations, `ASC`
   2. `max` Routing completion, `DESC`
2. **Fewest layers**
   1. `min` Layer count, `ASC`
3. **Most conservative fabrication rules**
   1. `max` Minimum trace width, `DESC`
   2. `max` Minimum trace clearance, `DESC`
   3. `max` Minimum drill size, `DESC`
   4. `max` Minimum via size, `DESC`
4. **PRC completion**
   1. `max` Passing Priority PRCs, `DESC`
   2. `max` Passing Other PRCs, `DESC`
5. **Most efficient routing**
   1. `min` Shortest traces, `ASC`


---

# Agent Instructions: 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:

```
GET https://docs.quilter.ai/candidate-review/sorting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
