{"id":23451414,"url":"https://github.com/coloquinte/1dtransport","last_synced_at":"2025-04-10T13:18:55.089Z","repository":{"id":210043270,"uuid":"613814447","full_name":"Coloquinte/1DTransport","owner":"Coloquinte","description":"Efficient algorithm for the 1D transportation problem","archived":false,"fork":false,"pushed_at":"2023-11-27T13:38:55.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-04T16:14:04.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/Coloquinte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-03-14T10:24:14.000Z","updated_at":"2024-09-07T20:24:22.000Z","dependencies_parsed_at":"2023-11-30T13:52:29.532Z","dependency_job_id":null,"html_url":"https://github.com/Coloquinte/1DTransport","commit_stats":null,"previous_names":["coloquinte/1dtransport"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2F1DTransport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2F1DTransport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2F1DTransport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coloquinte%2F1DTransport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coloquinte","download_url":"https://codeload.github.com/Coloquinte/1DTransport/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248225656,"owners_count":21068078,"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-12-24T00:25:58.069Z","updated_at":"2025-04-10T13:18:55.049Z","avatar_url":"https://github.com/Coloquinte.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nThis repository implements an algorithm for the unidimensional transportation problem.\n\n# 1D transportation problem\n\nIn the 1D transportation problem, we need to allocate supply from n sources to m sinks, with limits on supply and demand. The total supply may be smaller than the demand.\nEach sink and source has a position (an integer). The cost of allocating one unit of supply is the distance between the source and the sink.\n\nWith n sources and m sinks, the traditional algorithm runs in time larger than O(n²m²), with some approximation algorithms running in time O(mn).\nThe algorithm presented here runs in only O(n log n + m log m).\n\n# Using the solver\n\nTo use the code, copy the files transportation\\_1d.hpp and transportation\\_1d.cpp in your sources.\nOther files are only used for testing.\n\n```cpp\nTransportation1d pb(sourcePos, sinkPos, sourceSupply, sinkDemand);\nvector\u003cint, int, long long\u003e solution = pb.solve();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloquinte%2F1dtransport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoloquinte%2F1dtransport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoloquinte%2F1dtransport/lists"}