# Use Case: Optimization

After exploring the resource types and their instances of the scenario, we will now switch to the optimization part of Rembrandt. For this, click on the three bars on the top right and the main menu will open, on the right-hand side (black), the different parts required for the optimized resource allocation are listed. For now, let's start with **Algorithms** by clicking on it.

{% hint style="success" %}
You should now see a list with two algorithms *SMile Munkres* and *SMile Rule*. If not, click [here](http://localhost:3000/#/optimization/algorithms).
{% endhint %}

Click on one of the algorithms to explore their configuration, just as you did with the resource instances and their attributes. You can now see, which resource types this algorithm requires and which output it produces. For this scenario, both algorithms require resources of the types *Microdepot*, *Receiver*, and *Deliverer*, and they produce instances of the type *Tour*. Furthermore, you can see that each algorithm is linked to a Docker image — these are the ones you already [pulled in the set-up](https://rembrandt.gitbook.io/docs/set-up#getting-started).

![The algorithm "SMile Rule" in the scenario](https://2302517564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeJ6kGUyZS2zT96wHZ3%2F-MctYcxUl5ShcS9jTodu%2F-MctZkq_wSkqJiTEz_fE%2Fgrafik.png?alt=media\&token=4798488c-1ed8-4fe0-95a2-c4f2430175f9)

Now, switch to the **Recipes** using either the shortcut navigation menu on the top or again the main menu at the top right. Again, you will already see two instances, one for each algorithm. If you click on any of them, you will see the *Ingredients* of the recipe, i.e., which components comprise the recipe, such as the inputs, outputs, transformers, as well as any contained algorithms.

{% hint style="info" %}
In this scenario, there are no **Transformers** because the optimization algorithms were already adopted to fit the attribute schema of the resource types in this scenario.
{% endhint %}

You can now proceed to the [next step](https://rembrandt.gitbook.io/docs/use-case-guide/use-case-allocation), the actual allocation, or stay here and create your own recipe.

### Bonus: Create your own recipe

To create your own recipe, either click on **Create a Recipe** on a detail view of an existing recipe, or click on **Recipes** in the top bar and then the orange plus button at the bottom right.

Give your recipe a descriptive name and click **Continue**. You will now be presented with an empty modeling surface with several orange boxes to choose from. In this case, we want to use the existing *SMile Rule* algorithm. Click on the corresponding button on the left and drag the appearing element to the mid of the canvas.

![Modeling a new recipe for the scenario](https://2302517564-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LeJ6kGUyZS2zT96wHZ3%2F-MctaJDd4t22Ek6cY-Ep%2F-MctcgSG0nLJpAM3Jka4%2Fgrafik.png?alt=media\&token=0a74393d-c91b-4781-82ef-03be3791da66)

The element representing the algorithm already indicates which resource types it requires as input and which resource type it will produce. However, the inputs and outputs have to be added manually since it would be possible to use transformers in between or to even connect several algorithms in series.

Therefore, click on the **Inputs** *Microdepot*, *Receiver*, and *Deliverer* and the corresponding elements will appear on the canvas. As soon as you start dragging one of them, you will see that fitting connectors of the algorithm will turn green, indicating that the dragged element could be placed there. While dragging, move your cursor closer to the appropriate input field until it turns gray. Then let it go, and it will snap in place. Connect all three inputs with the algorithm.

Now, do the same for the **Output** *Tour*. Click on it on the left bar and drag it to the output connector of the algorithm. Then click on **Create Recipe** and you should be redirected to the overview of available recipes, now also showing your just created one. You can now proceed to the [next step](https://rembrandt.gitbook.io/docs/use-case-guide/use-case-allocation).
