Giter VIP home page Giter VIP logo

javascriptassignmentmodel's Introduction

Javascript Assignment Model

Implement Assignment Model using JavaSript

Hungarian method

This Library implement asssignment model using JavaScript. This model base on Hungarian method (Kuhn–Munkres algorithm or Munkres assignment algorithm).

Cost Table

--- JOB#1 JOB#2 JOB#3 JOB#4 JOB#5
Resource#1 7 5 9 8 11
Resource#2 9 12 7 11 10
Resource#3 8 5 4 6 9
Resource#4 7 3 6 9 5
Resource#5 4 6 7 5 11

Input in array form

[
    [7, 5, 9, 8, 11],
    [9, 12, 7, 11, 10],
    [8, 5, 4, 6, 9],
    [7, 3, 7, 5, 11],
    [4, 6, 7, 5, 11]
]

Usage Example

Hungarian.run(
    [
        [7, 5, 9, 8, 11],
        [9, 12, 7, 11, 10],
        [8, 5, 4, 6, 9],
        [7, 3, 6, 9, 5],
        [4, 6, 7, 5, 11]
    ]
)

Output

{ assign:
   { '1': { '2': 5 },
     '2': { '3': 7 },
     '3': { '4': 6 },
     '4': { '5': 5 },
     '5': { '1': 4 } },
  sum_cost: 27,
  matrix:
   [ [ 2, 0, 5, 2, 4 ],
     [ 1, 4, 0, 2, 0 ],
     [ 3, 0, 0, 0, 2 ],
     [ 4, 0, 4, 5, 0 ],
     [ 0, 2, 4, 0, 5 ] ] }

Reference

Books

  • Reder. Barry; Stair, Ralph M. Jr.; and Hanna, Michael E. Quantitative Analysis for management. 1th edition. Singapore : Pearson, 2012
  • รองศาสตราจารย์สุทธิมา ช านาญเวช, การวิเคราะห์เชิงปริมาณ Quantitative Analysis, กรุงเทพ ฯ : วิทยพัฒน์, 2561
  • สุปัญญา ไชยชาญ, การวิเคราะห์เชิงปริมาณ : ฉบับสมบูรณ์ พิมพ์ครั้งที่ 5. กรุงเทพ ฯ : พี.เอ. ลีฟวิ่ง, 2550

Website

javascriptassignmentmodel's People

Contributors

iamsarin avatar

Stargazers

 avatar  avatar

Watchers

James Cloos 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.