Giter Site home page Giter Site logo

greedyapproach's Introduction

GreedyApproach

Solving a problem by using Greedy method in Java Scenario of the Assignment: Assume that you are the owner of a football club. Your club has enough trainers to improve and promote ‘p’ players to the main squad from the youth team. Some other clubs ask to rent players from your club and make several demands for renting players from your club. The number of demands can be different from year to year. You should design a renting plan for the next ‘n’ years. Consider ‘i’ is the index of each year (i=1,…,n) and yi is the number of players will be requested to rent for ith year. If your club needs to promote more than ‘p’ players for a year, you can hire some coaches, paying ‘c’ TL costs per player for that year. However, if your club keeps any unrented player in that year, you should pay a ‘salary’ for a such player. An example to understand the problem: Your current trainers can promote p=5 players in a year, for a four years’ plan (n=4), y[ ] = { 8, 4, 7, 4 } and Salary(1) = 5, Salary(2)= 7, Salary(3)=10, Salary(4)=12, Salary(5)=13, etc. and c=10 TL. For the first year, your trainers can promote 5 players, however, the demand is 8. You can hire coaches with the cost of c*(8-5)=10*3= 30 TL. For the second year, the demand is 4, will you promote 5 players and keep 1 player in the squad for the next years for not paying coach costs? Or will you just promote just 4 players? Greedy approach that computes the minimum total costs to promote players for the planned n years. Some variables are given in the ‘yearly_player_demand.txt’ and ‘players_salary.txt’ files. The rest of variables (‘n’, ‘p’, ‘c’) will be assigned to constant values at the beginning of the code.

greedyapproach's People

Contributors

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