Skip to main content

FFFA: A Nature-Inspired Single Solution Optimization Algorithm

Project description

FFFA: Foxes and Fireflies Foraging Algorithm

PyPI Version License Downloads Python Versions GitHub Stars Last Commit Open Issues

FFFA is a nature-inspired single-solution optimization algorithm that mimics the foraging behavior of foxes and fireflies.
It is designed for solving path optimization problems (e.g., shortest path, graph-based problems) where a weight matrix is provided as input.


Installation

You can install FFFA directly from PyPI (after publishing):

pip install fffa

Usage Example

from fffa import fff

Example weighted adjacency matrix

weight_matrix = [
    [0, 2, 9, 0],
    [1, 0, 6, 4],
    [0, 7, 0, 8],
    [6, 3, 0, 0]
]

best_path, best_cost = fff(weight_matrix)

print("Best Path:", best_path)
print("Best Cost:", best_cost)

Features

Nature-inspired single-solution optimization algorithm

Works with any weighted adjacency matrix

Simple API with minimal dependencies

Lightweight and easy to integrate

Project Structure

FFFA/
│── fffa/                 # Main package
│   ├── __init__.py
│   ├── fff.py            # Main algorithm
│   ├── update.py         # Helper functions
│── tests/                # Test cases
│   └── test.py
│── requirements.txt      # Dependencies
│── README.md             # Documentation
│── setup.py              # Packaging setup
│── LICENSE

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fffa-0.1.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fffa-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file fffa-0.1.0.tar.gz.

File metadata

  • Download URL: fffa-0.1.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fffa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c8814645b3d48a70782f70ab5bc57c1cc95d9d71d2da3eaf979dc4f3e9472df4
MD5 3f9cc4a25fa4297448d7582a04ff70ae
BLAKE2b-256 2c1d9ce42ecd0a6599cc27bbbe6e5065035921ee0020c4cb853ed331d6d33b81

See more details on using hashes here.

File details

Details for the file fffa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fffa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fffa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6058bc337496bdc625abd8efbea0870513529d76a88f8437512d4ffbede088e0
MD5 ee0a6a178c30c73081ea6103aca378b5
BLAKE2b-256 0fe9c305f6ac4040a543b4c330b94c76939a385ab89bef251635a3f2214eb5c4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page