Giter VIP home page Giter VIP logo

graph-algorithms's Introduction

Graph-Algorithms

The codes containing the executable algorithms along with the driver function are available as 4 Python files in the directory 'codes' attached alongside. (genGraph.py, mainFile.py, Nearest_Hosp_MultiBFS.py and top_K_MultiBFS.py)

To execute the program, you can run mainFile.py on the terminal. (Do note that usage of a 64 bit python interpreter is recommended so that you don't face heap issues)

Make sure the algorithm files (Nearest_Hosp_MultiBFS.py and top_K_MultiBFS.py) are in the same directory as mainFile.py

Once the program begins execution, you will be displayed a menu, where you can upload Graph file, either generate a hospital list(based on hashing) or upload hospital files, enter output directory and run the algorithm of your choice

while entering the input file name, enter the full name along with the proper extension.

A few test files have been included in the "codes/Files" directory as a sample reference. if you want to use the files we have provided, enter "./Files/graph/<file_name>.txt" for inputting Graphs and "./Files/hospital/<file_name>.txt" for hospitals if you are using your own files, make sure you enter the entire directory of the file.

The outputs are stored in the files as pickle format. You can choose to enter the output file directory, otherwise, they are exported to the codes directory as "exportNearest.p" or "exportTopK.p" for the two algorithms respectively.

for the nearest Hospital Algorithm, we are dumping the shortest paths as well as the distance Dictionary to the file, in that order for the Top K hospitals Algorithm, we are dumping the topK distance dictionary to the pickle file.

To control what information is logged onto the console screen, you can access the developer options. You will be prompted with the options there and yoou can choose what you want to view on the console output. By default, only the process time is printed, you can choose to print the execution details, and the data structures as well.

A note on generating random graphs: You can open the genGraph.py file in your editor, enter the parameters N being the number of nodes, and the saveFile direcory. you can also change the edge density if you want, and run the file

graph-algorithms's People

Contributors

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