{"id":25382793,"url":"https://github.com/seehiong/micronaut-optimizer","last_synced_at":"2026-04-13T00:37:45.356Z","repository":{"id":270079359,"uuid":"909258563","full_name":"seehiong/micronaut-optimizer","owner":"seehiong","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-09T13:44:57.000Z","size":2095,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T14:34:59.383Z","etag":null,"topics":["chart-js","chatgpt","deepseek-r1","java","llm","micronaut-framework","ollama","openai","optimization","optimization-algorithms","vue"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/seehiong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-12-28T06:50:15.000Z","updated_at":"2025-02-09T13:46:35.000Z","dependencies_parsed_at":"2024-12-28T09:20:25.123Z","dependency_job_id":"4f18d977-8503-4231-964b-ab188ea45c41","html_url":"https://github.com/seehiong/micronaut-optimizer","commit_stats":null,"previous_names":["seehiong/micronaut-optimizer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehiong%2Fmicronaut-optimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehiong%2Fmicronaut-optimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehiong%2Fmicronaut-optimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seehiong%2Fmicronaut-optimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seehiong","download_url":"https://codeload.github.com/seehiong/micronaut-optimizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054217,"owners_count":21039951,"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":["chart-js","chatgpt","deepseek-r1","java","llm","micronaut-framework","ollama","openai","optimization","optimization-algorithms","vue"],"created_at":"2025-02-15T07:51:44.818Z","updated_at":"2026-04-13T00:37:40.315Z","avatar_url":"https://github.com/seehiong.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Micronaut Optimizer\n\n## Rationale\n\nThis repository contains the Micronaut Optimizer project, which aims to optimize various computational problems using the Micronaut framework. The project leverages the power of Micronaut for building lightweight, modular, and efficient applications.\n\n## Architecture\n\nThe architecture of the Micronaut Optimizer is visualized using PlantUML. Below is the updated PlantUML diagram representing the high-level architecture of the project.\n\n```plantuml\n@startuml\npackage \"io.github.seehiong\" {\n    package \"controller\" {\n        class ProgressController\n        class ProblemController\n    }\n    \n    package \"factory\" {\n        class SolverServiceFactory\n    }\n    \n    package \"service\" {\n        class SolverService\n        class BaseSolverService\n        class FLPService\n    }\n    \n    package \"utils\" {\n        class DisposableUtils \u003c\u003c (U,orchid) utility \u003e\u003e\n        class CoordUtils \u003c\u003c (U,orchid) utility \u003e\u003e\n        class FileUtils \u003c\u003c (U,orchid) utility \u003e\u003e\n    }\n\n    package \"model\" {\n        abstract class Input\n        class FLPInput\n        abstract class Output\n        class FLPOutput\n        interface Constraint\n        interface Objective\n        interface Metric\n        interface Metadata\n    }   \n\n    package \"solver\" {\n        interface Solver\n        class FLPSolver\n        class TSPSolver\n    }    \n}\n\nSolverService \u003c|.. BaseSolverService\nBaseSolverService \u003c|-- FLPService\nFLPService --\u003e DisposableUtils\n\nProgressController --\u003e Output\nProblemController --\u003e SolverService\nSolverServiceFactory -\u003e SolverService\nFLPSolver --|\u003e Solver\nTSPSolver --|\u003e Solver\n\nInput \u003c|-- FLPInput\nOutput \u003c|-- FLPOutput\nInput --\u003e Constraint\nInput --\u003e Objective\nOutput --\u003e Metric\nOutput --\u003e Metadata\n\nFLPSolver --\u003e CoordUtils\nFLPSolver --\u003e FileUtils\n@enduml\n```\n\n[optimizer-architecture](images/optimizer-architecture.png)\n\n### Key Features\n\n* Real-time Progress Monitoring: View optimization progress through SSE (Server-Sent Events)\n* Multiple Solver Support:\n  * Traveling Salesman Problem (TSP)\n  * Facility Location Problem (FLP)\n* Interactive Visualization: Dynamic visualization of solution progress\n* Factory Pattern: Extensible solver framework\n\n## Folder Structure\n\nThe folder structure of the project is as follows:\n\n```text\nmicronaut-optimizer/\n├── src/main/\n│   ├── java/io/github/seehiong/\n│   │   ├── controller/   # REST endpoints\n│   │   ├── factory/      # Solver factory implementation\n│   │   ├── micronaut/    # Application configuration\n│   │   ├── model/        # Data models and DTOs\n│   │   ├── service/      # Business logic layer\n│   │   ├── solver/       # Optimization algorithms\n│   │   └── utils/        # Utility classes\n│   └── resources/\n│       ├── application.yml  # Micronaut configuration\n│       ├── logback.yml      # Logging configuration\n│       └── static/          # Static resources (HTML, CSS, JS)\n│           ├── flp-progress.html\n│           ├── tsp-progress.html\n│           └── cvrp-progress.html\n├── build.gradle\n├── settings.gradle\n├── README.md\n```\n\n## Prerequisites\n\n* Java 21 or higher\n* Gradle 8.11 or higher\n* Web browser with SSE support\n\n## Installation\n\n1. Clone the repository:\n\n```shell\ngit clone https://github.com/seehiong/micronaut-optimizer.git\ncd micronaut-optimizer\n```\n\n2. Build the project:\n\n```shell\n./gradlew clean build\n```\n\n3. Run the application:\n\n```shell\n./gradlew run\n```\n\n4. Access the visualization:\n\n* TSP Progress: http://localhost:8080/tsp-progress.html\n* FLP Progress: http://localhost:8080/flp-progress.html\n\n## API Endpoints\n\n```text\nPOST /solve/{problem}           # Solve a problem with raw input\nPOST /solve/{problem}/upload    # Solve a problem with file upload\nGET /progress/latest/{solverId} # Get the latest output for a solver\nGET /progress/{solverId}        # Stream optimization progress\n```\n\n## Sample Inputs and Progress\n\n### Facility Location Problem (FLP)\n\n#### Input Json\n\n* Post to `http://localhost:8080/solve/flp`\n* Navigate to `http://localhost:8080/flp-progress.html?xScale=1500\u0026yScale=1500\u0026solverId=\u003cSOLVER_ID\u003e` for progess:\n\n```json\n{\n    \"facilityCostConstraint\": {\n        \"costs\": [100, 100, 100]\n    },\n    \"facilityCapacityConstraint\": {\n        \"capacities\": [100, 100, 500]\n    },    \n    \"facilityCoordinateConstraint\": {\n        \"coordinates\": [\n            {\"x\": \"1065\", \"y\": \"1065\"},\n            {\"x\": \"1062\", \"y\": \"1062\"},\n            {\"x\": \"0\",    \"y\": \"0\"}\n        ]\n    },\n    \"customerCoordinateConstraint\": {\n        \"coordinates\": [\n            {\"x\": \"1397\", \"y\": \"1397\"},\n            {\"x\": \"1398\", \"y\": \"1398\"},\n            {\"x\": \"1399\", \"y\": \"1399\"},\n            {\"x\": \"586\",  \"y\": \"586\"},\n            {\"x\": \"900\",  \"y\": \"900\"},\n            {\"x\": \"910\",  \"y\": \"910\"},\n            {\"x\": \"1200\", \"y\": \"1200\"},\n            {\"x\": \"1210\", \"y\": \"1210\"}\n        ]\n    },\n    \"customerDemandConstraint\": {\n        \"demands\": [50, 50, 75, 75, 80, 80, 90, 90]\n    }\n}\n```\n\n#### Progress\n\n![FLP Progress](images/flp-progress.png)\n\n### Traveling Salesman Problem (TSP)\n\n#### Input Json\n\n* Post to `http://localhost:8080/solve/tsp`\n* Navigate to `http://localhost:8080/tsp-progress.html?xScale=5\u0026yScale=5\u0026solverId=\u003cSOLVER_ID\u003e` for progess:\n\n```json\n{\n    \"distanceMatrixConstraint\": {\n        \"distances\": [\n            [ 0, 10, 15, 20, 25 ],\n            [10,  0, 35, 25, 20 ],\n            [15, 35,  0, 30, 10 ],\n            [20, 25, 30,  0, 15 ],\n            [25, 20, 10, 15,  0 ]\n        ]\n    },\n    \"solveTimeConstraint\": {\n        \"solveTime\": \"30s\"\n    },\n    \"minMaxObjective\": {\n        \"minMaxEnum\": \"MINIMIZE\"\n    }\n}\n```\n#### Progress\n\n![TSP Progress](images/tsp-progress.png)\n\n## Capacitated Vehicle Routing Problem (CVRP)\n\n#### Input Json\n\n* Post to `http://localhost:8080/solve/cvrp`\n* Navigate to `http://localhost:8080/cvrp-progress.html?xScale=20\u0026yScale=20\u0026solverId=\u003cSOLVER_ID\u003e` for progess:\n\n```json\n{\n    \"vehicleConstraint\": {\n        \"vehicleNumber\": 4,\n        \"capacity\": 15\n    },\n    \"customerDemandConstraint\": {\n        \"demands\": [0, 1, 1, 2, 4, 2, 4, 8, 8, 1, 2, 1, 2, 4, 4, 8, 8]\n    },\n    \"distanceMatrixConstraint\": {\n        \"distances\": [\n            [0, 548, 776, 696, 582, 274, 502, 194, 308, 194, 536, 502, 388, 354, 468, 776, 662],\n            [548, 0, 684, 308, 194, 502, 730, 354, 696, 742, 1084, 594, 480, 674, 1016, 868, 1210],\n            [776, 684, 0, 992, 878, 502, 274, 810, 468, 742, 400, 1278, 1164, 1130, 788, 1552, 754],\n            [696, 308, 992, 0, 114, 650, 878, 502, 844, 890, 1232, 514, 628, 822, 1164, 560, 1358],\n            [582, 194, 878, 114, 0, 536, 764, 388, 730, 776, 1118, 400, 514, 708, 1050, 674, 1244],\n            [274, 502, 502, 650, 536, 0, 228, 308, 194, 240, 582, 776, 662, 628, 514, 1050, 708],\n            [502, 730, 274, 878, 764, 228, 0, 536, 194, 468, 354, 1004, 890, 856, 514, 1278, 480],\n            [194, 354, 810, 502, 388, 308, 536, 0, 342, 388, 730, 468, 354, 320, 662, 742, 856],\n            [308, 696, 468, 844, 730, 194, 194, 342, 0, 274, 388, 810, 696, 662, 320, 1084, 514],\n            [194, 742, 742, 890, 776, 240, 468, 388, 274, 0, 342, 536, 422, 388, 274, 810, 468],\n            [536, 1084, 400, 1232, 1118, 582, 354, 730, 388, 342, 0, 878, 764, 730, 388, 1152, 354],\n            [502, 594, 1278, 514, 400, 776, 1004, 468, 810, 536, 878, 0, 114, 308, 650, 274, 844],\n            [388, 480, 1164, 628, 514, 662, 890, 354, 696, 422, 764, 114, 0, 194, 536, 388, 730],\n            [354, 674, 1130, 822, 708, 628, 856, 320, 662, 388, 730, 308, 194, 0, 342, 422, 536],\n            [468, 1016, 788, 1164, 1050, 514, 514, 662, 320, 274, 388, 650, 536, 342, 0, 764, 194],\n            [776, 868, 1552, 560, 674, 1050, 1278, 742, 1084, 810, 1152, 274, 388, 422, 764, 0, 798],\n            [662, 1210, 754, 1358, 1244, 708, 480, 856, 514, 468, 354, 844, 730, 536, 194, 798, 0]\n        ]\n    },\n    \"solveTimeConstraint\": {\n        \"timeInSeconds\": \"10\"\n    }\n}\n```\n\n#### Progress\n\n![CVRP Progress](images/cvrp-progress.png)\n\n## Bin Packing Problem (BPP)\n\n#### Input Json\n\n* Post to `http://localhost:8080/solve/bpp`\n* Navigate to `http://localhost:8080/bpp-progress.html?solverId=\u003cSOLVER_ID\u003e` for progess:\n\n```json\n{\n    \"itemWeightConstraint\": {\n        \"weights\": [48, 30, 19, 36, 36, 27, 42, 42, 36, 24, 30]\n    },\n    \"binCapacityConstraint\": {\n        \"capacity\": 100\n    }\n}\n```\n\n#### Progress\n\n![BPP Progress](images/bpp-progress.png)\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Submit a pull request\n\n## License\n\nMIT License","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseehiong%2Fmicronaut-optimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseehiong%2Fmicronaut-optimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseehiong%2Fmicronaut-optimizer/lists"}