{"id":16749647,"url":"https://github.com/chriskonnertz/binpacking","last_synced_at":"2025-03-16T03:43:12.910Z","repository":{"id":79200528,"uuid":"121423190","full_name":"chriskonnertz/BinPacking","owner":"chriskonnertz","description":"Examples of algorithms that solve the bin packing problem implemented in Kotlin","archived":false,"fork":false,"pushed_at":"2018-02-14T22:17:20.000Z","size":20,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-22T16:26:34.776Z","etag":null,"topics":["algorithm","bin-packing","binpacking","example","first-fit","first-fit-decreasing","kotlin","optimization","solving"],"latest_commit_sha":null,"homepage":null,"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/chriskonnertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2018-02-13T18:59:29.000Z","updated_at":"2018-05-18T02:25:29.000Z","dependencies_parsed_at":"2023-03-18T00:45:39.012Z","dependency_job_id":null,"html_url":"https://github.com/chriskonnertz/BinPacking","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"d50d057ad64565a1c02b9d43a03f250644ae96e3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskonnertz%2FBinPacking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskonnertz%2FBinPacking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskonnertz%2FBinPacking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chriskonnertz%2FBinPacking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chriskonnertz","download_url":"https://codeload.github.com/chriskonnertz/BinPacking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243822277,"owners_count":20353499,"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":["algorithm","bin-packing","binpacking","example","first-fit","first-fit-decreasing","kotlin","optimization","solving"],"created_at":"2024-10-13T02:25:30.336Z","updated_at":"2025-03-16T03:43:12.891Z","avatar_url":"https://github.com/chriskonnertz.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BinPacking\n\nWell documented examples of algorithms that solve the bin packing problem. Implemented in Kotlin.\nA demo is included (`Demo.kt`).\n\n\"In the bin packing problem, objects of different volumes must be packed into a finite number of bins or containers \neach of volume V in a way that minimizes the number of bins used.\"\nLearn more about the problem and the algorithms: https://en.wikipedia.org/wiki/Bin_packing_problem\n\n## Implemented algorithms\n\n* First Fit (class `FirstFit`)\n* First Fit Decreasing (class `FirstFitDecreasing`)\n\nThe concrete algorithm classes inherit from the abstract super class `BinPackagingAlgorithm`.\n\n## Usage\n\n```kotlin\n    /** These are the available capacities (sizes) of the bins */\n    val availableBinCapacities = arrayOf(5000, 6000, 70000)\n    /** These are the lengths (parts) that we want to put into bins */\n    val parts: List\u003cInt\u003e = listOf(1000, 2000, 3000, 4000)\n\n    val firstFit = FirstFit()\n    val result = firstFit.solve(availableBinCapacities, parts)\n    result.print()\n```\n\n## Example demo output\n\nOutput from the demo (`Demo.kt`): \n\n```\nTesting algorithms...\nAvailable bin capacities: 5000, 6000, 70000, \nParts: [1000, 2000, 3000, 4000]\n\nUsing class de.chriskonnertz.firstFit.FirstFit\nOptimization done.\nResult:\nBest bin capacity: 6000 - Used bins: 2 - Evaluation value: 2000\n1. Bin - Unused space: 0 - Parts: [1000, 2000, 3000]\n2. Bin - Unused space: 2000 - Parts: [4000]\n\nUsing class de.chriskonnertz.firstFit.FirstFitDecreasing\nOptimization done.\nResult:\nBest bin capacity: 5000 - Used bins: 2 - Evaluation value: 0\n1. Bin - Unused space: 0 - Parts: [4000, 1000]\n2. Bin - Unused space: 0 - Parts: [3000, 2000]\n\nProcess finished with exit code 0\n```\n\n\u003e Note: The demo is similar to the example code in the \"usage\" section but more detailed","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskonnertz%2Fbinpacking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchriskonnertz%2Fbinpacking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchriskonnertz%2Fbinpacking/lists"}