Skip to content
/ NFOpt Public

NFOpt is a tool for optimizing network flows by formulating and solving several types of optimization problems as well as multicommodity flow routing.

License

Notifications You must be signed in to change notification settings

sabotack/NFOpt

Repository files navigation


Logo

NFOpt

A network flow optimizer

Table of Contents
  1. About The Project
  2. Features
  3. Getting Started
  4. Contributors

About

NFOpt (Network Flow Optimizer) is a tool designed to optimize network flow by setting up problems as Linear Programming (LP) minimization problems. The optimizer can generate a baseline using uniform path splitting ratios for traffic, while available optimization models (average utilization, maximum utilization, and squared utilization) yield optimized ratios and utilization. Additionally, it can also be used to solve a multi-commodity flow problem over the network resulting in new optimized paths and their respective ratios.

Features

  • Generates baseline with uniform path splitting ratios
  • Optimizes network flow using LP with option for several minimization objectives
    • Average Utilization
    • Maximum Utilization
    • Squared Utilization
  • Utilizes multicommodity flow problem for path optimization

Getting Started

Prerequisites

Installation

  1. Clone the repository:
    git clone https://github.com/sabotack/NFOpt.git
    cd NFOpt
    
  2. Install the required dependencies:
    poetry install
    
  3. Set up environment variables:
    • Create a new file named: variables.env
    • Edit variables.env to include the necessary environment variables listed in variables.env-example

Data Format

Before you can start using the tool, ensure the following steps are completed:

  1. Data Formatting: Make sure your data is formatted according to the examples provided in the sample-data directory.
  2. Environment Variables: Set the environment variable for the data directory correctly in the variables.env file.
    You can use the variables.env-example file as a reference for the required environment variables and their values.
    Rename variables.env-example to .env and update it with the appropriate information.

Usage

  • Running baseline calculations:

    poetry run nfopt baseline [day]
    

    where [day] is an optional argument describing the day of data to use as an integer (default is 1).

  • Running optimization models:

    poetry run nfopt type [day]
    

    where type can be either 'average', 'max', 'squared' or 'paths'.

Optional Arguments

Argument Shortened Description
--help -h Displays information about all available arguments.
--use-ratios -ur Use existing path ratios for calculations, requires DAY, TYPE, and DATE in the format 1 squared 20240131.

DAY is the day of data the ratios you want to use are from.
TYPE is the type of optimization that the ratios are from.
DATE is the date the ratios are from.
--use-paths -up Use existing paths for calculations, requires DAY, DATE, and USERATIOS? (True or False) in the format 1 20240131 False.

DAY is the day of data the paths are from.
DATE is the date the paths are from.
USERATIOS indicates whether the ratios associated with the paths should be used or if new ones should be calculated instead.
--save-lp-models -slpm Save LP models of optimization to a file.

Contributors

  • sabotack (Ali Sajad Khorami)
  • EmilML (Emil Monrad Laursen)
  • SBejer (Simon Mikkelsen Bejer)
  • ViktorPlatz (Viktor Platz)

About

NFOpt is a tool for optimizing network flows by formulating and solving several types of optimization problems as well as multicommodity flow routing.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •  

Languages