Giter Site home page Giter Site logo

hsgraph's Introduction

CS438 Search

About

CLI program written in haskell to compare graph algorithms performance and use cases. Written with no external libraries because cabal/stack package manager is not available for use in the assignment testing environment.

Instructor building from the extracted zip

Shouldn't require any special compiler flags. All code is in the Main.hs file. The file is broken into comment blocks that wrap the code to outline distinctually different areas of the program. The block with the comment "Course Work" is all the logic pertaining to where the base assignment requirements are (ie Dijkstras, BFS, DFS).

ghc -o hsgraph ./app/Main.hs

Instructor Usage

  • All commands needed for full generation are available and tested on home.cs.siue.edu
  • The following command will generate a single PDF report and gif(s) to accompany each file found/provided to the command
  • WARNING
    • Do not try and run the gif generation on big graphs unless you have lots of ram
      • convert command used to build the GIF will steal all ram and cause a crash
    • Tested gif generation on siue home server with supplied graphPosLittle and it worked fine
  • The report generation generates distance tables for graphs <= 20 nodes. The table spans off the page if I don't do this and dynamically fixing is tricky
./hsgraph /path/to/my/(graphFile|graphFilledDir) /optionally/other/file(s) -r -g

Chat GPT

Shell Command Dependencies

  • Report Generation
    • pdflatex
  • Graph Generation
    • GraphViz Package
      • dot -> Builds a "prettier" graph but ignores the len attribute on edges
      • convert -> Builds gifs from the images
  • Other Builtins/Standard
    • which
    • whoami

Clone + Cabal Usage

git clone [email protected]:BrianTipton1/hsgraph.git
cabal run hsgraph -- "/path/to/my/(graphFile|graphFilledDir) -r -g"

Help Text

./hsgraph --help
Usage: hsgraph [OPTIONS] (FILE|DIR)*

Description:
    hsgraph is a command-line utility for parsing and analyzing graphs using Dijkstra's Algorithm, BFS and DFS.
    It operates on file(s) or multiple files within a directory(s).
    It can also generate gifs following Dijkstra's Algorithm using GraphViz graphs.
    The report and images for a given file are generated to $PWD/results/FILE_NAME/*

Options:
  -h, --help
    Show this help message and exit.

  -g, --gif
    Generate a gif following Dijkstra's Algorithm for the specified file(s).

  -r, --report
    Generate the report for the assignment on the specified files

  -s=2, --start-node=2
    Optionally supply a node to start algorithms from

Arguments:
  FILE
    Required. The path to a file(s) and or a directory(s) to be parsed.

Examples:
  hsgraph myfile.txt
  hsgraph myfile.txt /path/to/directory -s=5
  hsgraph /path/to/directory
  hsgraph /path/to/directory -g
  hsgraph myfile.txt -g
  hsgraph /path/to/directory -g --report
  hsgraph myfile.txt -g -r

Note:
  Ensure that the file(s) or directory(s) supplied only contains files that hsgraph can parse.
  Commands required for GIF generation is dot, convert
  Commands required for Report generation is dot, pdflatex

For future me

  • Resources Used
  • Interesting Packages
  • Things I wanted to do but couldn't do to various factors (Time/Runtime Environment/Accessibility)
    • Not have all code in one file
    • Better GraphViz implementation
      • Conversion of Graph type to VizImage is sloppy
      • Better structure of the VizImage and child types
    • Possibly some redundant code if genericization was thought through better
    • Parallization of image compilation using dot
    • Different GIF conversion implementation to accommodate a larger number of images
    • Nicer report generation. Also sloppy

hsgraph's People

Contributors

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