---
title: "optimize"
sidebar_label: "optimize"
description: "Kotlin binding reference: optimize."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[ModelGraph](index.md)/[optimize](optimize.md)

# optimize

[common]\
fun [optimize](optimize.md)(options: [OptimizeOptions](../OptimizeOptions/index.md) = OptimizeOptions()): [OptimizeReport](../OptimizeReport/index.md)

Run the graph optimizer with the graph's own transform list, iterated until an iteration changes nothing or the cap stops it; a transform that fails is undone and skipped, and the run goes on. Refuses `FAILED_PRECONDITION` on a finalized graph.