Skip to content

kakashy/graph-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graph Search

This is a js practice for graph search algorithms, breadth-first search and depth-first search.

Clone this repo and take a look:

npm i && npm start

Data

Sample data is a list of airports in Kenya:

NBO MSA NAK ELD KSM NYR NYK LOD MAL KIL KTL

Their hypothetical routes:

  ['NBO', 'MSA'],
  ['NBO','ELD'],
  ['NBO','KSM'],
  ['MSA', 'MAL'],
  ['MSA', 'KIL'],
  ['KSM', 'ELD'],
  ['KSM', 'KTL'],
  ['KTL', 'NYR'],
  ['NYK', 'NYR'],
  ['NYR', 'MSA'],
  ['KTL', 'LOD'],
  ['LOD', 'ELD'],

Graph Nodes

To create nodes, we append the airport short names to an empty map. Then, for each route, we fetch the origin from the mapped list and append the destination of the point index.

About

Graph Search Algorithms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published