{"id":17918613,"url":"https://github.com/ollevche/lem-in-v2","last_synced_at":"2025-04-03T08:12:36.611Z","repository":{"id":101917068,"uuid":"141332530","full_name":"ollevche/lem-in-v2","owner":"ollevche","description":":ant: Got a problem trying to move ants on a graph? Open this...","archived":false,"fork":false,"pushed_at":"2021-03-13T20:51:22.000Z","size":170,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-08T21:31:13.026Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","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/ollevche.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-17T19:11:49.000Z","updated_at":"2021-03-13T20:51:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"436cfa77-fc5d-4df1-8557-7913dafa541a","html_url":"https://github.com/ollevche/lem-in-v2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollevche%2Flem-in-v2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollevche%2Flem-in-v2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollevche%2Flem-in-v2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollevche%2Flem-in-v2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollevche","download_url":"https://codeload.github.com/ollevche/lem-in-v2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246961955,"owners_count":20861182,"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":[],"created_at":"2024-10-28T20:11:59.736Z","updated_at":"2025-04-03T08:12:36.588Z","avatar_url":"https://github.com/ollevche.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :ant: Lem-in V2\n\nImagine you have to transfer N ants from A to B on an Ant Farm (a graph) in the fastest possible way.\n\nThis program finds the best set of paths on a graph and does all the work!\n\n## The rules\n\n* You have a bunch of ants and a graph\n* Graph contains rooms (vertices) with unique names and links (edges) between these rooms\n* You can move as many ants as you want per step\n* You can't move an ant twice per step\n* Room can contain at most one ant at a time (except `start` and `end`)\n\n## How to use?\n\nThe program tries to build a graph from user input and finds the best set of paths for transfer.\n\nLets describe a simple graph:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"graph\" width=\"600px\" src=\"/assets/graph.png\" /\u003e\n\u003c/p\u003e\n\nOn the first line, you have to specify ants count:\n```\n100\n```\n\nThen, the program expects to read a list of rooms:\n```\ngreen 0 0\npurple 0 0\ndeadEnd 0 0\nblue 0 0\nred 0 0\n```\n\nTwo of them have to be marked as `start` and `end` rooms:\n```\n##start\nstart 0 0\n\n##end\nend 0 0\n```\n\nFinally, link existing rooms between each other:\n```\nstart-green\nstart-purple\nstart-deadEnd\nstart-blue\nblue-red\nred-end\ngreen-purple\npurple-end\ngreen-end\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003eHere is a complete example.\u003c/summary\u003e\n  \n  ```\n  # ants count\n  100\n  # rooms\n  green 0 0\n  purple 0 0\n  deadEnd 0 0\n  blue 0 0\n  red 0 0\n  ##start\n  start 0 0\n  ##end\n  end 0 0\n  # links\n  start-green\n  start-purple\n  start-deadEnd\n  start-blue\n  blue-red\n  red-end\n  green-purple\n  purple-end\n  green-end\n  ```\n  \n\u003c/details\u003e\n\nAs a result, **Lem-in V2** shows a list of some considered paths and the best set (with steps count - `e`):\n```\nFound paths (5):\npath_0 (3) [start, green, end]\npath_1 (3) [start, purple, end]\npath_2 (4) [start, blue, red, end]\npath_3 (4) [start, green, purple, end]\npath_4 (4) [start, purple, green, end]\n\nBest set (s = 3, e = 35):\npath_0 (3) [start, green, end]\npath_1 (3) [start, purple, end]\npath_2 (4) [start, blue, red, end]\n```\n\n## How to run?\n\n0. Ensure you have installed Java.\n1. Clone: `git clone https://github.com/ollevche/lem-in-v2 \u0026\u0026 cd lem-in-v2`\n2. Build via gradle wrapper: `./gradlew`\n3. Run jar file: `java -jar build/libs/lemin-2.0.jar`\n4. Get rid of this annoying problem with pathfinding when transferring ants on a graph!\n\n## About\n\nThis project is a part of the **42 School's** Algorithmic branch.\n\nOriginally, it has been implemented in **C** ([here is the repo](https://github.com/ollevche/lem-in)), this is **Java** version with a faster algorithm.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follevche%2Flem-in-v2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follevche%2Flem-in-v2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follevche%2Flem-in-v2/lists"}