Skip to main content

A novel multi-branch hypothesis evaluation system

Project description

False Feet Algorithm

Amoeba: Novel Multi-Branch Hypothesis Evaluation with Inverse Resource Allocation

A powerful algorithm for solving complex reasoning problems through competitive multi-branch investigation. Instead of giving more resources to strong hypotheses, we give MORE to weak ones—forcing them to improve or die off. When multiple independent reasoning paths converge on the same answer, that's a very robust signal.

📦 Two Implementations

This repository contains both C++ (original) and Python (new) implementations:

🐍 Python Version (python/)

  • Pure Python, minimal dependencies
  • Generic framework for any hypothesis evaluation problem
  • Medical diagnosis and mystery solving examples
  • 39 comprehensive tests (all passing)
  • Visualization tools (optional matplotlib)
  • Ready for PyPI publication
cd python
pip install -e .
python -m false_feet_algorithm.examples.mystery_solving

C++ Version (cpp/)

  • High-performance reference implementation
  • Original mystery solver ("The Vanished Necklace")
  • Generic framework with benchmarks
  • Full specification and execution traces
cd cpp
g++ -std=c++17 -O2 src/poirot_main.cpp -o solver
./solver

🎯 Core Innovation

Instead of giving resources to strong hypotheses, we give MORE to weak ones.

When weak branches are forced to improve or die off, and multiple independent reasoning paths converge on the same answer despite different starting assumptions—that's a highly robust signal.

The 6-Phase Algorithm

Each iteration:

  1. Investigation — Branches evaluate current evidence
  2. Evaluation — Score each hypothesis (0-1)
  3. Resource AllocationINVERSE ranking (weakest gets most slots!)
  4. Evidence Gathering — Branches propose new data to investigate
  5. Starvation & Culling — Non-improving branches gradually die
  6. Convergence Check — All agree? → SOLVED

🐍 Python Quick Start

cd python
pip install -e ".[viz]"

python -m false_feet_algorithm.examples.mystery_solving
python -m false_feet_algorithm.examples.clinical_diagnosis

Extend for Your Domain

from false_feet_algorithm.core import Problem, Option, DataPoint, BaseBranch, BaseEvaluator, AmoebaInvestigation

class YourBranch(BaseBranch):
    def evaluate(self, data_pool):
        # Your domain reasoning logic
        return score  # 0.0-1.0
    
    def propose_data(self, data_pool):
        # Suggest next evidence/tests
        return proposed_ids

class YourEvaluator(BaseEvaluator):
    def evaluate(self, branch, data_pool):
        # Your scoring logic
        return score

problem = Problem(title="Your Problem")
# ... add options and evidence ...

solver = AmoebaInvestigation(
    problem,
    branch_class=YourBranch,
    evaluator=YourEvaluator()
)
result = solver.solve()

📚 Documentation

Python (python/)

  • API docs in false_feet_algorithm/core/
  • Examples in false_feet_algorithm/examples/
  • Tests in false_feet_algorithm/tests/
  • Full README in python/README.md

C++ (cpp/)

  • QUICK_START.md — Visual introduction (15 min)
  • EXECUTION_TRACE.md — Detailed walkthrough (1 hour)
  • amoeba_algorithm_spec.md — Full formal spec (4+ hours)
  • BENCHMARKS.md — Performance analysis
  • Source code in src/

🧪 Test Case: The Vanished Necklace

Both versions solve the classic mystery:

  • Problem: Identify the culprit among 4 suspects
  • Evidence: 13 pieces of investigative clues
  • Solution: All branches converge on Butler

Run it:

# Python
cd python && python -m false_feet_algorithm.examples.mystery_solving

# C++
cd cpp && g++ -std=c++17 -O2 src/poirot_main.cpp -o solver && ./solver

📦 Publishing (Python)

The Python implementation is ready for PyPI:

cd python
pip install build twine
python -m build
twine upload dist/*

Users can then install with:

pip install false-feet-algorithm
pip install false-feet-algorithm[viz]  # With visualization

📊 Quick Comparison

Aspect Python C++
Language Python 3.7+ C++17
Speed Good Excellent
Setup pip install g++ compile
Extensibility Easy (subclass) Moderate (templates)
Dependencies Minimal (none core) None
Best For Research, production Performance-critical
PyPI Ready ✅ Yes ❌ No

🤝 Contributing

See CONTRIBUTING.md for development guidelines.

Ways to contribute:

  • Python: New domains, improved evaluators, optimizations
  • C++: Benchmarking, performance optimization, research
  • Both: Examples, documentation, tutorials

📄 License

MIT License - see LICENSE file


Next steps:

  1. Python users: cd python && pip install -e ".[viz]"
  2. C++ users: cd cpp && cat docs/QUICK_START.md
  3. Researchers: cd cpp && cat docs/BENCHMARKS.md

Questions? Open an issue on GitHub.

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

false_feet_algorithm-0.1.0.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

false_feet_algorithm-0.1.0-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: false_feet_algorithm-0.1.0.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for false_feet_algorithm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed18f224ea4df058698a8ec9b37426d318921a77d85fae0ef9c4ee96b495c10a
MD5 93c12799700da1ff894e8a1eb95c0364
BLAKE2b-256 86864a824a7128eccffcc157597076015f6e2a2af9e3beca2babf53556317060

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for false_feet_algorithm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa2b04911e97969e29378b1c511130dffd9e62880f632db7762ca35673f92cc7
MD5 d17c3306732d9125d006a8b51c90b56c
BLAKE2b-256 633ec6d07c85f0abe4c57655fa384679c315cbd4c51840d654cdbda35c062add

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