GithubHelp home page GithubHelp logo

mff-linprog's Introduction

Intro

Program for generating MathProg scripts for glpk solver.

Requirements

Usage

  • Use linprog vstup-XXX.txt vystup-XXX.mod -d -r command.
  • In general linprog [-h --help] [inputFileName] [outputFileName] [-r --run] [-d --debug].
  • If outputFileName is not specified, output.mod is used.

Build

  • Use dotnet build command.
  • Program builds to ./bin/Debug/net6.0/ directory

Options

  • -h|--help - Display help informations.
  • -r|--run - Run glpsol automatically.
  • -d|--debug - Display debug informations during run.

Program structure

  • Program
    • Main(string[] args) : void - Entry point.
    • WriteHelpInfo() : void - Write help informations to output.
    • ReadWeightedDirectedGraph(string firstLine, StreamReader reader) : Graph - Read input to Graph object instance and return it.
    • WriteGlpkScript(Graph graph, StreamWriter writer) : void - Write data from Graph instance to .mod file using MathProg language.
    • RunGlpSol(string outputFile) : void - Automatically run glpsol -m outputFile.mod command.
  • Graph
    • Directed graph object that stores dictionary of vertices and of their neighbors.
  • Vertex
    • Only holds its Id.
  • Edge
    • Oriented edge object that holds its first and second vertex.

Output

  • set Edges := {(v1,v2,weight),...}; - List of edges.
  • var r{(i, j, w) in Edges}, >= 0, <=1, integer; - Variable r(i,j,w) for each edge in {0,1} indicating, whether edge shoud be removed or not.
  • minimize obj: sum{(i, j, w) in Edges} r[i, j, w]*w; - Minimizing objective function.
  • c0: r[v1,v2,w1] + r[v2,v3,w2] + r[v3,v1,w3] >= 1; - Condition for each cycle of lenth three of four. Means that at least one edge must be removed (r[v1,v2,w] set to 1).

mff-linprog's People

Contributors

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