Giter Club home page Giter Club logo

ia-astar's Introduction

A-Star search algorithm python implementation

A little implementation of AStar search algorithm in python with a few defined basic heurisitc functions. Still a lot of improvements to do.

Execution modes & configuration

Execution behaviour can be changed in TP_Astar.py with a few parameters.

# ASTAR CONFIGURATION #################################################
SOURCE_CITY = "Warsaw"      # Source city
TARGET_CITY = "Lisbon"      # Desination city
TEST_ALL_HEURISTIC = True   # Choisir si exécute toutes les heuristiques ou celle d'en dessous
HEURISTIC_FUNCTION = h4     # Heuristic function [h0, h1, h2, h3, h4]
PRINT_STEPS_MODE = True     # Print frontiere + history each iteration
######################################################################

Heuristic functions

Can be added / modified in f_heuristics.py.

def h0(cityA, cityB):
    return 0

def h1(cityA, cityB):
    return fabs(cityA.x - cityB.x)

def h2(cityA, cityB):
    return fabs(cityA.y - cityB.y)

def h3(cityA, cityB):
    return cityA.distance_bird(cityB)

def h4(cityA, cityB):
    return h1(cityA, cityB) + h2(cityA, cityB)

ia-astar's People

Contributors

ishydo avatar

Stargazers

Guillaume Petitpierre avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.