Skip to content

Commit 877baaa

Browse files
committed
Readme update
1 parent 4efdb74 commit 877baaa

File tree

8 files changed

+160
-27
lines changed

8 files changed

+160
-27
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
4+
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8+
9+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
11+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12+
13+
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,57 @@
55

66
_In optimum we trust._
77

8-
GreyJack Solver is an AI constraint solver for Python (current version) built on top of Polars.
9-
It empowers you to solve a wide range of constraint optimization problems, including continuous, integer, and mixed-integer challenges.
8+
GreyJack Solver is a "jack of all trades" constraint metaheuristic solver for Python, built on the robust foundations of Rust and Polars. It empowers you to tackle a wide array of constraint optimization problems, including continuous, integer, and mixed-integer challenges with ease and efficiency.
109

1110
# Editions
1211

1312
There are 2 editions of GreyJack Solver:
1413

15-
- [Rust version](https://github.com/CameleoGrey/greyjack-solver-rust/) Ready to use, but there is still a lot of work to "complete" solver.
16-
- Python version (this repo, developing in progress...).
17-
18-
# Common info
19-
20-
Developing of Python version is in progress. Repo is public to bind repo name, pip package name and show, that there will be something more than only Rust version.
14+
- Python edition
15+
- [Rust edition](https://github.com/CameleoGrey/greyjack-solver-rust)
16+
17+
# Key Features of GreyJack Solver (Rust version)
18+
19+
- **Unmatched Comfort, Expressiveness, Flexibility and speed of developing** Designed to express alomost any optimization problem with maximum comfortability and clarity.
20+
- **Universality** Supports a wide range of constraint problems, including continuous, integer, and mixed-integer challenges. Additionally, thanks to Polars, you can optimize virtually any process that can be represented as table data.
21+
- **Python's Comfort Meets Rust's Speed** All computationally intensive parts of the solver are implemented in Rust and seamlessly integrated into Python, offering fast development cycles with production-ready performance for ~95% real-world tasks.
22+
- **Clarity and Simplicity** GreyJack provides a clear and straightforward approach to designing, implementing, and improving effective solutions for nearly any constraint problem and scenario.
23+
- **Nearly Linear Horizontal Scaling** The multi-threaded solving process is organized as a collective effort of individual agents (using the island computation model for all algorithms), which share results with neighbors during solving. This approach ensures nearly linear horizontal scaling, enhancing both the quality and speed of solutions (depending on agent settings and the problem at hand).
24+
- **Support for Population and Local Search Algorithms** GreyJack Solver supports a wide range of metaheuristics, including population-based and local search algorithms, with highly flexible settings. You can easily find, select, and configure the approach that best fits your problem, delivering optimal results.
25+
- **Easy Integration** The observer mechanism (see examples) simplifies integration, making it straightforward to incorporate GreyJack Solver into your existing workflows..
26+
27+
# Get started with GreyJack Solver in Rust
28+
29+
```
30+
pip install greyjack
31+
```
32+
33+
- Explore examples. Docs and guides will be later. GreyJack is very intuitively understandable solver (even Rust version).
34+
- Simply solve your tasks simply.
35+
36+
# Install GreyJack Solver from source
37+
38+
- Be sure that you've installed Rust (rustup) and Python on your machine.
39+
```
40+
- (create venv, activate it, cd greyjack-solver-python/greyjack)
41+
pip install maturin
42+
maturin develop --release
43+
```
44+
- maturin will build the Rust part, get all Python dependencies (for solver itself, not examples) and install greyjack to your venv
45+
46+
# RoadMap
47+
48+
- SimulatedAnnealing
49+
- API for modelling pure math problems (classic solvers like)
50+
- Modern variations (modifications) of LSHADE (Differential evolution algorithms often appear in articles as sota approaches)
51+
- CMA, probably its modern variants, adaptations for tasks with integer and categorical variables (often appears in articles as sota approach)
52+
- Add more examples: Job-Shop, Pickup&Delivery, some continuous and MIP tasks, scheduling, etc
53+
- Composite termination criterion (for example: solving limit minutes N AND score not improving M seconds)
54+
- Multi-level score
55+
- Custom moves support
56+
- Try to impove incremental (pseudo-incremental) score calculation mechanism (caching, no clonning, etc)
57+
- Write docs
58+
- Website
59+
- Useful text materials, guides, presentations
60+
- Tests, tests, tests...
61+
- Score explainer / interpreter

examples/object_oriented/vrp/score/IncrementalScoreCalculatorVRP.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def all_in_one_constraint(self, planning_entity_dfs, problem_fact_dfs, delta_dfs
4040
time_window_ends = self.utility_objects["time_window_ends"]
4141
service_times = self.utility_objects["service_times"]
4242
else:
43-
# to not catch error in the not time_windowed scenario
43+
# to not catch error in the not time_windowed scenario
44+
# (jitted function needs types anyway)
4445
work_day_starts = np.zeros((1,), dtype=np.int64)
4546
work_day_ends = np.zeros((1,), dtype=np.int64)
4647
time_window_starts = np.zeros((1,), dtype=np.int64)

examples/object_oriented/vrp/scripts/solve_vrp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#termination_strategy = ScoreLimit(score_to_compare=[0])
4747
agent = TabuSearch(neighbours_count=128, tabu_entity_rate=0.0,
4848
mutation_rate_multiplier=None, move_probas=[0.5, 0.5, 0.0, 0.0, 0.0, 0.0],
49-
compare_to_global=True, migration_frequency=10, termination_strategy=termination_strategy)
49+
compare_to_global=False, migration_frequency=10, termination_strategy=termination_strategy)
5050
"""agent = GeneticAlgorithm(population_size=512, crossover_probability=0.5, p_best_rate=0.2,
5151
tabu_entity_rate=0.0, mutation_rate_multiplier=None, move_probas=[0.5, 0.5, 0.0, 0.0, 0.0, 0.0],
5252
migration_rate=0.00001, migration_frequency=10, termination_strategy=termination_strategy)"""
@@ -55,8 +55,8 @@
5555
termination_strategy=termination_strategy)"""
5656

5757
solver = Solver(domain_builder, cotwin_builder, agent,
58-
ParallelizationBackend.Threading, LoggingLevel.FreshOnly,
59-
n_jobs=1, score_precision=[0, 0, 0])
58+
ParallelizationBackend.Multiprocessing, LoggingLevel.FreshOnly,
59+
n_jobs=10, score_precision=[0, 0, 0])
6060
solution = solver.solve()
6161

6262
domain = domain_builder.build_from_solution(solution)
@@ -98,8 +98,8 @@
9898
mutation_rate_multiplier=None, move_probas=[0.5, 0.5, 0.0, 0.0, 0.0, 0.0],
9999
compare_to_global=True, migration_frequency=10, termination_strategy=termination_strategy)
100100
solver = Solver(domain_builder, cotwin_builder, agent,
101-
ParallelizationBackend.Threading, LoggingLevel.FreshOnly,
102-
n_jobs=1, score_precision=[0, 0, 0],
101+
ParallelizationBackend.Multiprocessing, LoggingLevel.FreshOnly,
102+
n_jobs=10, score_precision=[0, 0, 0],
103103
initial_solution=domain)
104104
solution = solver.solve()
105105
domain = domain_builder.build_from_solution(solution, initial_domain=domain)

greyjack/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ polars = { version = "0.46.0", features = ["lazy", "ndarray", "serde", "abs"] }
2222
# if you build lib from source code
2323
# uncomment to gain max performance (increases calculation speed about 5-10%,
2424
# but also increases build time ~20x times)
25-
#[profile.release]
26-
#lto = true
27-
#codegen-units = 1
28-
#debug = true
29-
#opt-level = 3
25+
[profile.release]
26+
lto = true
27+
codegen-units = 1
28+
debug = true
29+
opt-level = 3
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright (c) 2025 Ritchie Vink
2+
Some portions Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
4+
Permission is hereby granted, free of charge, to any person obtaining a copy
5+
of this software and associated documentation files (the "Software"), to deal
6+
in the Software without restriction, including without limitation the rights
7+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is
9+
furnished to do so, subject to the following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all
12+
copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20+
SOFTWARE.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley
4+
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
8+
9+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
10+
11+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
12+
13+
Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

greyjack/README.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,57 @@
55

66
_In optimum we trust._
77

8-
GreyJack Solver is an AI constraint solver for Python (current version) built on top of Polars.
9-
It empowers you to solve a wide range of constraint optimization problems, including continuous, integer, and mixed-integer challenges.
8+
GreyJack Solver is a "jack of all trades" constraint metaheuristic solver for Python, built on the robust foundations of Rust and Polars. It empowers you to tackle a wide array of constraint optimization problems, including continuous, integer, and mixed-integer challenges with ease and efficiency.
109

1110
# Editions
1211

1312
There are 2 editions of GreyJack Solver:
1413

15-
- [Rust version](https://github.com/CameleoGrey/greyjack-solver-rust/) Ready to use, but there is still a lot of work to "complete" solver.
16-
- Python version (this repo, developing in progress...).
17-
18-
# Common info
19-
20-
Developing of Python version is in progress. Repo is public to bind repo name, pip package name and show, that there will be something more than only Rust version.
14+
- Python edition
15+
- [Rust edition](https://github.com/CameleoGrey/greyjack-solver-rust)
16+
17+
# Key Features of GreyJack Solver (Rust version)
18+
19+
- **Unmatched Comfort, Expressiveness, Flexibility and speed of developing** Designed to express alomost any optimization problem with maximum comfortability and clarity.
20+
- **Universality** Supports a wide range of constraint problems, including continuous, integer, and mixed-integer challenges. Additionally, thanks to Polars, you can optimize virtually any process that can be represented as table data.
21+
- **Python's Comfort Meets Rust's Speed** All computationally intensive parts of the solver are implemented in Rust and seamlessly integrated into Python, offering fast development cycles with production-ready performance for ~95% real-world tasks.
22+
- **Clarity and Simplicity** GreyJack provides a clear and straightforward approach to designing, implementing, and improving effective solutions for nearly any constraint problem and scenario.
23+
- **Nearly Linear Horizontal Scaling** The multi-threaded solving process is organized as a collective effort of individual agents (using the island computation model for all algorithms), which share results with neighbors during solving. This approach ensures nearly linear horizontal scaling, enhancing both the quality and speed of solutions (depending on agent settings and the problem at hand).
24+
- **Support for Population and Local Search Algorithms** GreyJack Solver supports a wide range of metaheuristics, including population-based and local search algorithms, with highly flexible settings. You can easily find, select, and configure the approach that best fits your problem, delivering optimal results.
25+
- **Easy Integration** The observer mechanism (see examples) simplifies integration, making it straightforward to incorporate GreyJack Solver into your existing workflows..
26+
27+
# Get started with GreyJack Solver in Rust
28+
29+
```
30+
pip install greyjack
31+
```
32+
33+
- Explore examples. Docs and guides will be later. GreyJack is very intuitively understandable solver (even Rust version).
34+
- Simply solve your tasks simply.
35+
36+
# Install GreyJack Solver from source
37+
38+
- Be sure that you've installed Rust (rustup) and Python on your machine.
39+
```
40+
- (create venv, activate it, cd greyjack-solver-python/greyjack)
41+
pip install maturin
42+
maturin develop --release
43+
```
44+
- maturin will build the Rust part, get all Python dependencies (for solver itself, not examples) and install greyjack to your venv
45+
46+
# RoadMap
47+
48+
- SimulatedAnnealing
49+
- API for modelling pure math problems (classic solvers like)
50+
- Modern variations (modifications) of LSHADE (Differential evolution algorithms often appear in articles as sota approaches)
51+
- CMA, probably its modern variants, adaptations for tasks with integer and categorical variables (often appears in articles as sota approach)
52+
- Add more examples: Job-Shop, Pickup&Delivery, some continuous and MIP tasks, scheduling, etc
53+
- Composite termination criterion (for example: solving limit minutes N AND score not improving M seconds)
54+
- Multi-level score
55+
- Custom moves support
56+
- Try to impove incremental (pseudo-incremental) score calculation mechanism (caching, no clonning, etc)
57+
- Write docs
58+
- Website
59+
- Useful text materials, guides, presentations
60+
- Tests, tests, tests...
61+
- Score explainer / interpreter

0 commit comments

Comments
 (0)