
Security News
pnpm 10.12 Introduces Global Virtual Store and Expanded Version Catalogs
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
gradient-swarm-optimization
Advanced tools
A Python implementation of Gradient-guided Swarm Optimization algorithm
A Python implementation of the Gradient-guided Swarm Optimization algorithm, designed for solving binary optimization problems. The algorithm uses a mathematically grounded approach combining gradient-based directional guidance with neighborhood learning mechanisms.
pip install gso
from gso import GSO
import numpy as np
def simple_fitness(solution):
"""Example fitness function: maximize sum of elements."""
return np.sum(solution)
GSO.run(
obj_func=simple_fitness,
dim=100,
pop_size=1000,
max_iter=800,
obj_type='max',
neighbour_count=3,
gradient_strength=0.8,
base_learning_rate=0.1
)
To run the test examples (UFLP and DUF problems):
git clone https://github.com/gazioglue/gso.git
cd gso
python examples/solve_uflp.py examples/data/uflp/test_instances/cap71.txt
python examples/solve_dufs.py duf1
For UFLP:
python solve_uflp.py cap71.txt --pop-size 2000 --max-iter 1000 --seed 42
For DUF:
python solve_dufs.py duf2 --dim 200 --pop-size 2000 --seed 42
For more detailed usage instructions and examples, see USAGE.md.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like change.
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
A Python implementation of Gradient-guided Swarm Optimization algorithm
We found that gradient-swarm-optimization demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.
Security News
Amaro 1.0 lays the groundwork for stable TypeScript support in Node.js, bringing official .ts loading closer to reality.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.