Giter VIP home page Giter VIP logo

sc-solver's Introduction

Project

Proof of concept using a graph to solve retail supply chain problems. Given a network of vendors, DCs, and stores, the solver will distribute product to satisfy edge max setting, and in order of need of the stores. In the case of scarcity with a max set on an edge that will not allow a store to order up to it's target, the store with the greatest ratio between target and inventory will receive product first.

It will solve for any graph so long as the graph is a DAG (Directed Acyclic Directed) graph.

Edges will have their flow-amounts updated to show the total amount of product that flowed through that edge to supply the stores.

A max can be set on any edge and the solver will honor the max.

When the solver is done it will launch a visual of the solved graph with graphviz. You can inspect the flow-amounts on the edges to see how much product has been allocated.

Motivation

To show a graph library can be used to greatly simplify the SC problem space.

Getting Started

Prerequisites

[Leiningen] (http://leiningen.org) [graphviz] (http://www.graphviz.org)

Installing

From working leiningen installation

  • lein install

Running tests

There are 4 graphs pre-described in sc-solver.test-solver namespace.

  • Graph 1 is a simple graph with no constraints.
  • Graph graph-dc-store-constrained has a constraint on the dc to store-0 edge
  • Graph graph-vendor-dc-constrained Has a constraint on the vendor to dc. When we flow this graph, we can see that store-0 gets the 1 product allocated, since it has the greatest need.
  • Graph graph-large Is simply a large graph to show the solver can work on any graph.

Running sample graphs.

  • Start a REPL using lein repl.
  • Switch to the sc-solver.test-solver name space.
  • Run tests with lein test: (in-ns 'sc-solver.test-solver)

View any of the graphs before being solved using: (uber/viz-graph graph-1 {:auto-label true})

Run the solver using: (s/flow-graph graph-1)

Tests written on core functions using clojre.test Tests can be found under sc-sover/test

License

Copyright © 2016 Eric Zimmerman

Distributed under the Eclipse Public License version 1.0.

sc-solver's People

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.