Code Monkey home page Code Monkey logo

graph-algorithms's Introduction

Graph Algorithms

Depth-First Search (DFS)
  • dfs-recursive.js: Implements DFS using recursion.
  • dfs.js: Implements DFS without recursion, using a stack.
Breadth-First Search (BFS)
  • bfs.js: Implements BFS using a queue.
Path Existence in Graphs
  • hasPath.js: Determines if there is a path between two nodes in a directed graph.
  • hasPathUndir.js: Determines if there is a path between two nodes in an undirected graph.
Shortest Path
  • shortest-path.js: Finds the shortest path between two nodes in a graph.
Island Problems
  • island-count.js: Counts the number of islands in a grid.
  • largest-component.js: Finds the size of the largest island in a grid.
  • min-island.js: Finds the size of the smallest island in a grid.

To clone this project, run:

git clone https://github.com/HilalKocak/graph-algorithms.git

  • To traverse with dfs, run:
node dfs.js
  • To traverse with dfs with recursive function, run:
node dfs-recursive.js
  • To traverse with bfs, run:
node bfs.js
  • To solve hasPath problem solution for directed graphs, run:
node hasPath.js
  • To solve hasPath problem solution for undirected graphs, run:
node hasPathUndir.js
  • To find count of components in a given graph, run:
node count-conn.js
  • To find the size of largest component in a given graph, run:
node largest-component.js
  • To solve shortest path problem
node shortest-path.js
  • To count islands of 2D matrix(grid), run:
node island-count.js
  • To find the size of the minimum island, run:
node min-island.js

graph-algorithms's People

Contributors

hilalkocak avatar

Stargazers

Seyyid Yiğit 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.