{"id":21187683,"url":"https://github.com/holgerbrandl/kortools","last_synced_at":"2025-04-13T17:51:07.703Z","repository":{"id":65565471,"uuid":"594487721","full_name":"holgerbrandl/kortools","owner":"holgerbrandl","description":"A kotlin API around OR Tools","archived":false,"fork":false,"pushed_at":"2023-01-30T08:19:35.000Z","size":88,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T08:48:08.139Z","etag":null,"topics":["constraintprogramming","industrialengineering","kotlin","lp","mip","optimization"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/holgerbrandl.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-01-28T17:49:36.000Z","updated_at":"2024-09-12T14:03:26.000Z","dependencies_parsed_at":"2023-02-16T01:31:11.274Z","dependency_job_id":null,"html_url":"https://github.com/holgerbrandl/kortools","commit_stats":{"total_commits":14,"total_committers":2,"mean_commits":7.0,"dds":0.2142857142857143,"last_synced_commit":"11c963e9c49ed0b25a738a5512abeadda6490603"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgerbrandl%2Fkortools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgerbrandl%2Fkortools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgerbrandl%2Fkortools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/holgerbrandl%2Fkortools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/holgerbrandl","download_url":"https://codeload.github.com/holgerbrandl/kortools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248758197,"owners_count":21156957,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constraintprogramming","industrialengineering","kotlin","lp","mip","optimization"],"created_at":"2024-11-20T18:39:49.816Z","updated_at":"2025-04-13T17:51:07.681Z","avatar_url":"https://github.com/holgerbrandl.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kortools\n\nA kotlin API around [OR Tools](https://developers.google.com/optimization) \n\n[ ![Download](https://img.shields.io/github/v/release/holgerbrandl/kortools) ](https://github.com/holgerbrandl/kortools/releases) [![Build Status](https://github.com/holgerbrandl/kortools/workflows/build/badge.svg)](https://github.com/holgerbrandl/kortools/actions?query=workflow%3Abuild) [![slack](https://img.shields.io/badge/slack-datascience-yellowgreen)](https://kotlinlang.slack.com/messages/datascience/)\n\n`kortools` provides a more natural API to express optimization problems on the JVM with the great OR as solver backend.\n\n`kortools` is designed for simulation practitioners, process analysts and industrial engineers, who need to go beyond the limitations of existing simulation tools to model and optimize their business-critical use-cases.\n\n## Example\n\n```kotlin\n// Create the linear solver with the GLOP backend.\nval solver = createSolver(SolverId.GLOP) {\n    // Create the variables x and y.\n    val x by makeVariable(0.0, 1.0)\n    val y by makeVariable(0.0, 1.0)\n\n    // Create a linear constraint, 0 \u003c= x + y \u003c= 2.\n    constraint(\"ct\", 0.0 to 2.0) {\n        x withCoeff 1.0\n        y withCoeff 1.0\n    }\n\n    // Create the objective function, 3 * x + y.\n    maximize {\n        3 * x + y\n    }\n}\n\n// solve the problem\nsolver.solve()\n\nwith(solver) {\n    println(\"Solution:\")\n    println(\"Number of variables = \" + numVariables())\n    println(\"Number of constraints = \" + numConstraints())\n    println(\"Objective value = \" + objective().value())\n    println(\"x = \" + variable(\"x\").solutionValue())\n    println(\n        \"y = \" + variable(\"y\").solutionValue()\n    )\n}\n```\n\n\n## Jupyter\n\nAn easy way to get started with `kortools` is with jupyter, you simply need to install the [kotlin-jupyter](https://github.com/Kotlin/kotlin-jupyter) kernel and load the library with:\n\n```bash\n%use kortools\n```\n\nSee [here](misc/optimize_cvrp.ipynb) for a notebook example.\n\n## Setup\n\nAdd the following artifact to your `gradle.build`\n\n```\ncompile \"com.github.holgerbrandl:kortools:0.5\"\n```\n\nYou can also use [JitPack with Maven or Gradle](https://jitpack.io/#holgerbrandl/kortools/-SNAPSHOT) to build the latest snapshot as a dependency in your project.\n\n```groovy\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\ndependencies {\n        compile 'com.github.holgerbrandl:kortools:-SNAPSHOT'\n}\n```\n\nTo build and install it into your local maven cache, simply clone the repo and run\n```bash\n./gradlew install\n```\n\n## Misc References\n\n\nhttps://github.com/google/or-tools/tree/stable/ortools/linear_solver/samples","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholgerbrandl%2Fkortools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fholgerbrandl%2Fkortools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fholgerbrandl%2Fkortools/lists"}