Features โข Installation โข Usage โข Mathematical Framework โข Examples โข Documentation โข Citation
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.
- 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
# 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
from src.rgs_core import adaptability, rgm_distance
# Calculate adaptability for a specific configuration
x = 0.5
d_res = 10.0
N_ord = list(range(1, 13)) # Orbital orders {1, 2, ..., 12}
a = adaptability(x, d_res, N_ord)
print(f"Adaptability at x={x}: {a}")
# Calculate RGM distance between two points
x1, x2 = 0.3, 0.7
d_base = abs(x1 - x2) # Base distance (e.g., Euclidean)
d_rgm = rgm_distance(x1, x2, d_res, N_ord, d_base, w=2.0)
print(f"Base distance: {d_base}, RGM distance: {d_rgm}")
from src.rgs_viz import plot_adaptability_landscape, plot_adaptability_profile
# Plot adaptability landscape
fig, ax = plot_adaptability_landscape(
x_range=(0, 1),
d_res_range=(1, 100),
N_ord=list(range(1, 13)),
log_scale_d_res=True
)
# Plot adaptability profiles for different d_res values
fig, ax = plot_adaptability_profile(
x_range=(0, 1),
d_res_values=[1.0, 5.0, 10.0, 50.0],
N_ord=list(range(1, 13))
)
from src.rgs_pathfinding import standard_a_star, rgm_a_star
# Define grid parameters
grid_size = (20, 30)
start = (2, 2)
goal = (17, 27)
# Define mapping from grid positions to x values
def grid_to_x_map(row, col):
return ((row * 0.1 + col * 0.05) * 2.0) % 2.0
# Run standard A* search
standard_path = standard_a_star(grid_size, start, goal)
# Run RGM-guided A* search
rgm_path = rgm_a_star(
grid_size=grid_size,
start=start,
goal=goal,
grid_to_x_map=grid_to_x_map,
d_res=20.0,
N_ord=list(range(1, 13)),
w=2.0
)
# Run all tests
python -m unittest discover tests
# Run specific test file
python -m tests.test_mathematical_properties
# Compile the LaTeX report
bash compile_latex.sh
The RGS framework is built upon two key mathematical constructs:
The adaptability metric
where the coupling function
with
The Resonance-Guided Metric (RGM) modifies a base distance metric by incorporating adaptability values:
where the modulating function is:
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.
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
If you use this framework in your research, please cite:
@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}
}
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.