Code Monkey home page Code Monkey logo

hw4-prim-mst's Introduction

HW 4: Prim's algorithm

In this assignment, you'll implement Prim's algorithm, a non-trivial greedy algorithm used to construct minimum spanning trees.

Tasks

Coding

  • [TODO] Complete the construct_mst method found in mst/graph.py. All necessary modules have already been imported. You should not rely on any other dependencies (e.g. networkx).

Development

  • [TODO] Add more assertions to the check_mst function in test/test_mst.py.
  • [TODO] Write at least one more unit test (in the test_mst.py file) for your construct_mst implementation. (Two unit tests have already been provided: the first operates on a small graph of four nodes, and the second on a larger graph of 140 single cells, projected onto a lower dimensional subspace.)
  • [Optional] Make your package pip installable. (Refer to prevous assignments for more in-depth information.)
  • [Optional] Automate testing with pytest and GitHub Actions, and add a status badge to this README file. (Refer to previous assignments for more in-depth information.)

Getting started

Fork this repository to your own GitHub account. Work on the codebase locally and commit changes to your forked repository.

You will need following packages:

We also strongly recommend you use the built-in heapq module.

Completing the assignment

Push your code to GitHub with passing unit tests, and submit a link to your repository through this google form link

Grading

Code (6 points)

  • Minimum spanning tree construction works correctly (6)
    • Correct implementation of Prim's algorithm (4)
    • Produces expected output on small graph (1)
    • Produces expected output on single cell data (1)

Unit tests (3 points)

  • Complete function "check_mst" (1)
  • Write at least two unit tests for MST construction (2)

Style (1 points)

  • Readable code with clear comments and method descriptions (1)

Extra credit (0.5)

  • Github actions/workflow (0.5)

hw4-prim-mst's People

Contributors

k-chrispens avatar hchen725 avatar khanu263 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.