项目作者: lkoshale

项目描述 :
A* ( Star) algorithm for dynamic graphs on GPU
高级语言: Cuda
项目地址: git://github.com/lkoshale/DA_STAR.git
创建时间: 2020-01-28T01:47:01Z
项目社区:https://github.com/lkoshale/DA_STAR

开源协议:MIT License

下载


DA_STAR

License: MIT
build:failing

This repository contains the generic implementation of the A*(star) algorithm for dynamic graphs.
Full code in repository: link

About

A* is one of the widely used path planning and shortest path approximation algorithms. It is applied in a diverse set of problems from path-finding in video games and robotics to codon optimization in genetics. In this work, we focus on A* for graphs that are subjected to update operation, where an update operation refers to the insertion or
deletion of an edge. Instead of performing A* again from start each time graph is subject to update, our algorithm process the sub-graphs which are affected by the update. For temporal graph available at SNAP
for 100 updates we got 25x-40x of performance improvement over repeated A* search. More details

Features

  • Supports both directed and undirected positively weighted graphs
  • Supports all types of heuristics function
  • Supports insertions/deletions of edges onto the graph
  • Uses Diff CSR to store dynamic graphs
  • improved performance from repeated A* search

System Requirements

To use this library ensure you meet the following requirements:

Linux

How to Build

This library is self-contained in the header files at the include directory of this repository with all required classes and functions defined.

  • You can copy the headers of this library to your projects include directory :

    • cp -r DA_STAR/include/ <your-project>/include/
  • Or You can copy the headers of this library to your root/CUDA include folder

    • sudo cp -r DA_STAR/include/ /usr/include/
    • cp -r DA_STAR/include/ <CUDA_PATH>/include/

Examples

  1. #include "include/dynamic_graph.cuh"
  2. #include "include/d_a_star.cuh"
  3. #include "include/utils.cuh"
  4. int main(){
  5. std::string input_graph = "graph.txt";
  6. std::string input_updates = "updates.txt";
  7. //reuires weight type
  8. GPU_Dynamic_Graph<unsigned int> graph;
  9. graph.read(input_graph);
  10. int start_node = 0; //start node
  11. int end_node = 7; //end node
  12. int num_pq = 10; //number of parallel priority queue
  13. //requires weight type and heuristics/Cost type
  14. GPU_D_A_Star<unsigned int, int> algo(&graph,start_node,end_node,num_pq);
  15. graph.set_update_file(input_update);
  16. while(graph.update()){
  17. std::vector<int> path = algo.get_path();
  18. print_path(path);
  19. }
  20. return 0;
  21. }

Dynamic Graphs

Credits