Git Product home page Git Product logo

graph's Introduction

Graphs!

How we're implementing

While your assignemtn will use an adjacency matrix based implementation of a graph, I've given you the code for an adjacency list implementation!

The whole graph is a vector of lists, where every list represents a single node's outgoing edges. To make undirected graphs simpler, I've pretended thate they're directed graphs with edges pointing both ways.

Your tasks

###Understanding Dijkstra's Algorithm

Pull out that piece of paper and draw out Dijkstra's algorithm (performed on node A) for each of the following graphs (notice that these are the graphs that you're programming for, so you can use this practice run of Dijkstra's as a test bench):

###Programming Dijkstra's Algorithm

Implement Dijkstra's Algorithm to start at the passed in node and print a report for the graph, so if 0 (A) was pass in for my made up graph, The report should show the distance and how you got there like:

A: 0 
B: 5 A->C->B
C: 2 A->C
D: Unreachable
E: 9 A->G->F->D
...

Tip: when you're storing your theoretical distances, use INT_MAX after you've included climits to represent infinity

###BFS And DFS

Implement algorithms to print the nodes in BFS order and DFS order.

graph's People

Contributors

chumponimys avatar scohe001 avatar

Watchers

 avatar  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.