{"id":19341828,"url":"https://github.com/agrover112/fliscopt","last_synced_at":"2025-04-23T03:32:05.014Z","repository":{"id":37792283,"uuid":"347739886","full_name":"Agrover112/fliscopt","owner":"Agrover112","description":"Algorithms for flight scheduling optimization.","archived":false,"fork":false,"pushed_at":"2023-07-13T15:58:42.000Z","size":73740,"stargazers_count":42,"open_issues_count":7,"forks_count":12,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-20T14:51:51.803Z","etag":null,"topics":["genetic-algorithm","hacktoberfest","hacktoberfest2021","heuristic-search-algorithms","optimization-algorithms","pypy3","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/fliscopt/","language":"Python","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/Agrover112.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["agrover112"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":["paypal.me/agrover112"]}},"created_at":"2021-03-14T19:56:46.000Z","updated_at":"2025-04-15T18:37:43.000Z","dependencies_parsed_at":"2023-09-26T03:46:29.736Z","dependency_job_id":null,"html_url":"https://github.com/Agrover112/fliscopt","commit_stats":{"total_commits":272,"total_committers":13,"mean_commits":"20.923076923076923","dds":0.3933823529411765,"last_synced_commit":"15c95902d805190687b0f56188b40c688ef90ea5"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agrover112%2Ffliscopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agrover112%2Ffliscopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agrover112%2Ffliscopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Agrover112%2Ffliscopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Agrover112","download_url":"https://codeload.github.com/Agrover112/fliscopt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365764,"owners_count":21418747,"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":["genetic-algorithm","hacktoberfest","hacktoberfest2021","heuristic-search-algorithms","optimization-algorithms","pypy3","python","python3"],"created_at":"2024-11-10T03:32:38.409Z","updated_at":"2025-04-23T03:32:04.723Z","avatar_url":"https://github.com/Agrover112.png","language":"Python","funding_links":["https://github.com/sponsors/agrover112","paypal.me/agrover112"],"categories":[],"sub_categories":[],"readme":"# Fliscopt \n[![DOI](https://zenodo.org/badge/347739886.svg)](https://zenodo.org/badge/latestdoi/347739886)\n\n![Stars](https://img.shields.io/github/stars/Agrover112/fliscopt) ![Forks](\thttps://img.shields.io/github/forks/Agrover112/fliscopt) ![License](https://img.shields.io/github/license/Agrover112/fliscopt)  ![Issues](https://img.shields.io/github/issues/Agrover112/fliscopt) \n[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)\n[![Open Source Love png1](https://badges.frapsoft.com/os/v1/open-source.png?v=103)](https://github.com/ellerbrock/open-source-badges/)\n[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://GitHub.com/CharlesAverill/satyrn/graphs/commit-activity)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)\n[![PyPI](https://img.shields.io/pypi/v/fliscopt)](https://pypi.org/project/fliscopt/)\n![Tweet](https://img.shields.io/twitter/url?url=https%3A%2F%2Fgithub.com%2FAgrover112%2Ffliscopt)\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/Agrover112)\n\n![image](./images/fliscopt_graphic.jpg)\n\nFLIght SCheduling OPTimization 🛫 or *fliscopt* is a simple optimization library for flight scheduling and related problems in the discrete domain. Flight scheduling opt here refers to  generating schedules of optimal cost for round-trips.\n\nThe library supports plotting, asynchronous multiprocessing, and unimodal optimization benchmarks.\nThe following repository contains code for the paper \"XYZ\". The experiments were performed in **PyPy3.7** and **CPython 3.8.10.**\n\nFollowing algorithms have been implemented and test as of date:\n\n**Algorithms**:\n- Hill Climbing \n- Random Search \n- Simulated Annealing \n- Genetic Algorithm \n- Genetic Algorithm in Reverse Mode\n- Genetic  Algorithm with Reversals\n- Genetic Algorithm with Random Search as a Reversal/Reverse Process\n- Iterated Chaining\n\nTake a look at the [docs](https://gizmotronn.github.io/fliscopt/docs) or the [Appendix](https://github.com/Agrover112/fliscopt/blob/master/Supplementaty%20Material%20and%20Appendix.pdf) for more details.\n# Getting Started\n\nInstall the library using pip:\n```bash\npip install fliscopt\n```\nOr for unreleased versions:\n```bash\npip install git+https://github.com/Agrover112/fliscopt/fliscopt@branchname\n```\nOr for development:\n```bash\ngit clone https://github.com/Agrover112/fliscopt.git\ncd fliscopt\npip install .\n```\n\nDownload the flights.txt file from the following [link](https://drive.google.com/file/d/1-wxzUMLloeF1tGYEVHvBG_Dh6jfZ-pzR/view) and add it to a data/ directory within your parent directory.\n\nA sample code demonstrating how to use fliscopt:\n```python\nfrom fliscopt.utils.util import print_schedule, read_file,plot_scores\nfrom fliscopt.rs import RandomSearch\nfrom fliscopt.ga import GA, ReverseGA, GAReversals, GARSReversals\nfrom fliscopt.hc import HillClimb\nfrom fliscopt.chaining import IteratedChaining\nfrom fliscopt.fitness import fitness_function,domain,griewank\n\n\n\nread_file('flights.txt')\nsga=GAReversals(seed_init=False,search=False,n_k=250,number_generations=1000)\nsoln, cost, scores, nfe, seed = sga.run(domain=domain['domain'], fitness_function=fitness_function,seed=5)\nplot_scores(scores, sga.get_base(),fname='flight_scheduling', save_fig=False)\n\n\nsga2=GARSReversals(seed_init=False,search=False,n_k=250,number_generations=1000)\nsoln, cost, scores, nfe, seed = sga2.run(domain=domain['domain'], fitness_function=fitness_function,seed=5)\nplot_scores(scores, sga2.get_base(),fname='flight_scheduling', save_fig=False)\n\n```\nThis results in the following two plots:\n\n![](https://github.com/Agrover112/fliscopt/blob/master/examples/image.png)\n\nCheckout out the examples in the [examples](https://github.com/Agrover112/fliscopt/tree/master/examples) directory or run in [Google Collab](https://colab.research.google.com/drive/1C9tPvDvauUPxxkL4ItGYP1Azlg6NUBaW?usp=sharing)\n\n## For PyPy users\nThe instructions for setup are mentioned in the setup directory. Alternatively, you can set up using this bash script. A requirements file is provided just in case.\nThe script creates and activates a PyPy Conda environment with all libraries and dependencies.\n```bash\ncd ./setup.sh\nsource setup.sh\n```\nThen install using:\n\n```bash\npypy -mpip install fliscopt\n```\n# Testing\nAfter adding any new algorithm, you can run the tests to check if the code is working properly.\n```bash\n./run_tests.sh\n```\n\n# Results\n\n## Experimental Results\nResults were compared by using the same seeds. The following table shows the results of the experiments. Flight scheduling results have been shown below.\n\n| Algorithm | Mean cost | Std.dev | Min cost | Max cost | n.fe. | Time(millsecond) | \n|-----------|-----------|---------|----------|----------|-------|------------------|\n| SGA       | 2780.9    | 205.75  | 2356     | 3081     | 1000  | 9.36             |   \n| GAwRo     | 2629.8    | 213.79  | 2356     | 3004     | 1000  | 9.66             |   \n| GAwR      | 2593      | 183.89  | 2356     | 2973     | 1099  | 10.16            |   \n| HC        | 4177.7    | 817.72  | 2759     | 5839     | 328   | 0.33             |   \n| RS        | 4545.3    | 271.95  | 4143     | 5165     | 100   | 0.17             |   \n| SA        | 3726.5    | 578.16  | 2759     | 4679     | 512   | 0.24             |   \n| RS+HC     | 3050.7    | 399.72  | 2356     | 3771     | 1657  | 2.23             |   \n| GARSRev   | 2592.9    | 168.45  | 2356     | 2888     | 1099  | 9.97             | \n\n\n## Accessing results\nAfter running the experiments, the results are stored in the results directory. The results are stored in the following format in subdirectories:\n```\n.\n├── multi_proc\n│   ├── ackley_N2\n│   │   ├── genetic_algorithm_results.csv\n│   │   ├── genetic_algorithm_reversed_results.csv\n│   │   ├── genetic_algorithm_with_reversals_results.csv\n│   │   ├── hill_climb_results.csv\n│   │   ├── random_search_results.csv\n│   │   └── simulated_annealing_results.csv\n│   ├── booth/...\n|   |\n|   |\n│   └── zakharov\n│       ├── genetic_algorithm_results.csv\n│       ├── genetic_algorithm_reversed_results                  \n│       ├── genetic_algorithm_with_reversals_results.csv\n│       ├── random_search_results.csv\n│       └── simulated_annealing_results.csv\n├── plots\n│   ├── ackley_N2\n│   ├── fitness_function\n│   │   ├── hill_climb.png\n│   │   └── random_search.png\n│   ├── flight_scheduling\n│   │   ├── simulated_annealing.png\n│   │   ├── sol_chaining.png\n│   │   └── sol_chaining_a1.png\n│   └── griewank\n```\n# References \nRead and Cite the following References for detailed understanding and use of our project.\n\n[1] [Grover, A., Yadav, V., Alicea, B. (2023). Flipping the Switch on Local Exploration: Genetic Algorithms with Reversals. In: Kumar, S., Sharma, H., Balachandran, K., Kim, J.H., Bansal, J.C. (eds) Third Congress on Intelligent Systems. CIS 2022. Lecture Notes in Networks and Systems, vol 608. Springer, Singapore](https://doi.org/10.1007/978-981-19-9225-4_52)\n\n\n\n[2] [Alicea B., Grover A., Lim A. ,Parent J, Unified Theory of Switching. Flash Talk presented at: 4th Neuromatch Conference; December 1 - 2, 2021](https://youtu.be/aTqgPbKQUD8)\n\n# Contributing Guidelines\nRefer [Contributing.md](./CONTRIBUTING.md) and Project Board for mode details.\nThis repository follows [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrover112%2Ffliscopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagrover112%2Ffliscopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagrover112%2Ffliscopt/lists"}