GithubHelp home page GithubHelp logo

avanish269 / baseball-elimination-problem Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 143 KB

Given the standings in a sports league at some point during the season, determine which teams have been mathematically eliminated from winning their division.

Home Page: https://www.cs.princeton.edu/courses/archive/spring04/cos226/assignments/baseball.html

C++ 100.00%
baseball-elimination maxflow-mincut max-flow maxflow c-plus-plus cpp ford-fulkerson ford-fulkerson-algorithm edmonds-karp-algorithm edmonds-karp

baseball-elimination-problem's Introduction

Baseball Elimination


CONTENTS OF THIS FILE
  • Introduction
  • Prequisites
  • Compilation
  • Execution
  • Top-Down Analysis

INTRODUCTION

The program baseballEliminations.cpp is used to determine which teams have been mathematically eliminated from the division in a sports league when standings are given at some point during the season. When provided with the input, this program, for each team creates a flow network and applies the Edmonds–Karp version of Ford-Fulkerson algorithm to find the max flow and hence determine if the team is eliminated or not.

  • For a full description of the problem, visit here.
  • For a full description of the Edmonds-Karp algorithm, visit here.

PREREQUISITES
  • First a c++ compiler like, g++ (MinGW.org GCC Build-20200227-1) 9.2.0, should be installed.
  • Then iostream, fstream, sstream, climits, string, vector, stack, queue and algorithm header files should be available.
  • The input format is the number of teams in the division n followed by one line for each team. Each line contains the team name (with no internal whitespace characters), the number of wins, the number of losses, the number of remaining games, and the number of remaining games against each team in the division.

COMPILATION
  • In windows, g++ -o baseballElimination.exe baseballElimination.cpp command in command prompt will compile an create an executable.
  • In linux, g++ baseballElimination.cpp in terminal will create the object.

Execution
  • In windows, baseballElimination.exe command in command prompt will execute the program. Just enter the input file path.
  • In linux, ./a.out in terminal will execute the program. Again enter the input file path.

Top-Down Analysis
  • First the input file is used to create a division. Here division is a class which stores all the data in their right data type.
  • Then after creating an object of divison we use it to create a flow network which is a class for graph. There we use the Ford-Fulkerson algorithm to determine if the team is eliminated or not.

Authors
  • Avanish Kumar Singh

baseball-elimination-problem's People

Contributors

avanish269 avatar

Stargazers

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