https://github.com/bbarclay/resonance-guided-search
A novel heuristic framework for pathfinding and optimization based on adaptability in conserved systems
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.0%) to scientific vocabulary
Keywords
Repository
A novel heuristic framework for pathfinding and optimization based on adaptability in conserved systems
Basic Info
- Host: GitHub
- Owner: bbarclay
- License: mit
- Language: Python
- Default Branch: main
- Size: 3.89 MB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Resonance-Guided Search: A Novel Heuristic Framework
Resonance-Guided Search (RGS) is a mathematically rigorous framework for pathfinding and optimization that incorporates adaptability considerations from conserved systems. By modulating standard distance metrics with an adaptability function, RGS guides search algorithms toward solutions that balance efficiency with robustness.
🌟 Features
- Adaptability Metric: Compute and visualize the adaptability landscape for various orbital orders and depth parameters
- Resonance-Guided Metric (RGM): Modulate standard distance metrics to guide search toward adaptable states
- Pathfinding Algorithms: Compare standard A* search with RGM-guided A* search in grid-based environments
- Visualization Tools: Generate heatmaps, profiles, and pathfinding comparisons
- Mathematical Proofs: Includes rigorous proofs for key properties of the framework
- Comprehensive Testing: Verify all theoretical claims through unit tests
- Interactive Demo: Explore the framework's behavior through an interactive Jupyter notebook
🔧 Installation
```bash
Clone the repository
git clone https://github.com/yourusername/resonance-guided-search.git cd resonance-guided-search
Create a virtual environment (optional but recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install dependencies
pip install -r requirements.txt ```
📊 Usage
Core Functionality
```python from src.rgscore import adaptability, rgmdistance
Calculate adaptability for a specific configuration
x = 0.5 dres = 10.0 Nord = list(range(1, 13)) # Orbital orders {1, 2, ..., 12} a = adaptability(x, dres, Nord) print(f"Adaptability at x={x}: {a}")
Calculate RGM distance between two points
x1, x2 = 0.3, 0.7 dbase = abs(x1 - x2) # Base distance (e.g., Euclidean) drgm = rgmdistance(x1, x2, dres, Nord, dbase, w=2.0) print(f"Base distance: {dbase}, RGM distance: {drgm}") ```
Visualization
```python from src.rgsviz import plotadaptabilitylandscape, plotadaptability_profile
Plot adaptability landscape
fig, ax = plotadaptabilitylandscape( xrange=(0, 1), dresrange=(1, 100), Nord=list(range(1, 13)), logscaled_res=True )
Plot adaptability profiles for different d_res values
fig, ax = plotadaptabilityprofile( xrange=(0, 1), dresvalues=[1.0, 5.0, 10.0, 50.0], Nord=list(range(1, 13)) ) ```
Pathfinding
```python from src.rgspathfinding import standardastar, rgma_star
Define grid parameters
grid_size = (20, 30) start = (2, 2) goal = (17, 27)
Define mapping from grid positions to x values
def gridtox_map(row, col): return ((row * 0.1 + col * 0.05) * 2.0) % 2.0
Run standard A* search
standardpath = standardastar(gridsize, start, goal)
Run RGM-guided A* search
rgmpath = rgmastar( gridsize=gridsize, start=start, goal=goal, gridtoxmap=gridtoxmap, dres=20.0, N_ord=list(range(1, 13)), w=2.0 ) ```
Running Tests
```bash
Run all tests
python -m unittest discover tests
Run specific test file
python -m tests.testmathematicalproperties ```
Compiling the LaTeX Report
```bash
Compile the LaTeX report
bash compile_latex.sh ```
🧮 Mathematical Framework
The RGS framework is built upon two key mathematical constructs:
Adaptability Metric
The adaptability metric $A(x, d_{res})$ is defined as the average of coupling functions across a set of orbital orders:
$$A(x, d{res}) = \frac{1}{|N{ord}|} \sum{n \in N{ord}} hn(x, d{res})$$
where the coupling function $hn(x, d{res})$ for orbital order $n$ is:
$$hn(x, d{res}) = \left|\sin(n\cdot\theta(x))\right|^{d{res}/n} \cdot \left|\cos(n\cdot\phi(x, d{res}))\right|^{1/n}$$
with $\theta(x) = 2\pi(x - x0)$ and $\phi(x, d{res}) = d{res}\pi(x - x0)$.
Resonance-Guided Metric
The Resonance-Guided Metric (RGM) modifies a base distance metric by incorporating adaptability values:
$$d{rgm}(x1, x2) = d{base}(x1, x2) \cdot f{mod}\left(A(x1, d{res}), A(x2, d_{res})\right)$$
where the modulating function is:
$$f{mod}(A1, A2) = \frac{1}{1 + w \cdot \frac{A1 + A_2}{2} + \epsilon}$$
📈 Examples
Adaptability Landscapes
Pathfinding Comparison
📚 Documentation
The codebase is structured into three main modules:
rgs_core.py: Core mathematical functions for computing adaptability and RGMrgs_viz.py: Visualization functions for adaptability landscapes and profilesrgs_pathfinding.py: Implementation of standard and RGM-guided A* search
For detailed documentation, see the full report.
📋 Project Structure
resonance-guided-search/
├── docs/
│ ├── pdf/
│ │ └── report.pdf
│ └── tex/
│ └── report.tex
├── figures/
│ ├── A_landscape_Baseline.png
│ ├── A_landscape_Sparse.png
│ ├── A_profiles_Baseline.png
│ └── pathfinding_comparison.png
├── src/
│ ├── __init__.py
│ ├── rgs_core.py
│ ├── rgs_pathfinding.py
│ └── rgs_viz.py
├── tests/
│ ├── __init__.py
│ ├── test_adaptability_landscape.py
│ ├── test_mathematical_properties.py
│ └── test_rgm_pathfinding.py
├── notebooks/
│ └── rgs_interactive_demo.ipynb
├── compile_latex.sh
├── requirements.txt
└── README.md
📝 Citation
If you use this framework in your research, please cite:
bibtex
@article{resonance_guided_search,
title={Resonance-Guided Search: A Novel Heuristic Framework Based on Adaptability in Conserved Systems},
author={Your Name},
journal={arXiv preprint},
year={2023}
}
🔗 Related Work
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Owner
- Login: bbarclay
- Kind: user
- Repositories: 1
- Profile: https://github.com/bbarclay
GitHub Events
Total
- Push event: 3
- Create event: 4
Last Year
- Push event: 3
- Create event: 4