Network Optimization: Quick Start

📝 Abstract

This lecture serves as an introductory guide to the algorithms used to solve network optimization problems. It covers several important concepts and techniques for both beginners and advanced users. The lecture begins by explaining how to explore the locality and associativity of a network, solve discrete optimization problems, and gain insight into critical parts of the network's cut and cycle. It then delves into basic concepts such as nodes, edges, orientation, the node-edge incidence matrix, and the boundary operator. It then explains the flow and potential of a network. It also examines feasibility problems and provides examples such as clock skew scheduling and delay padding. The lecture concludes with guidelines for algorithm developers and average users, suggesting special handling of multi-edges and techniques for finding negative cycles and cuts. Overall, the lecture provides a quick start guide to network optimization, covering important algorithms and concepts needed to tackle such problems.

📖 Introduction

Why and why not

  • 👍 Algorithms are available for common network problems (Python: networkx, C++: Boost Graph Library (BGL)):

    • Explore the locality of network.
    • Explore associativity (things can be added up in any order)
  • 👍 Be able to solve discrete problems optimally (e.g. matching/assignment problems)

  • 👍 Bonus: gives you insight into the most critical parts of the network (critical cut/cycle)

  • 👎 The theory is hard to understand.

  • 👎 Algorithms are hard to understand (some algorithms do not allow users to have an input flow in reverse directions, but create edges internally for the reverse flows).

  • 👎 There are too many algorithms available. You have to choose them wisely.

Flow and Potential

  • Cut
  • Current
  • Flow
  • Sum of around a node = 0

flow

  • Cycle/Path
  • Voltage
  • Tension
  • Sum of around a cycle = 0

potential

If you don't know more...

  • For the min-cost linear flow problem, the best guess is to use the "network simplex algorithm".

  • For the min-cost linear potential problem: formulate it as a dual (flow) problem.

  • For the parametric potential problem (single parameter), the best guess is to use Howard's algorithm.

  • All these algorithms are based on the idea of finding "negative cycle".

  • You can apply the same principle to the nonlinear problems.

For dual problems...

  • Dual problems can be solved by applying the same principle.

  • Finding negative cycles is replaced by finding a negative "cuts", which is more difficult...

  • ...unless your network is a planar graph.

Guidelines for the average users

  • Look for specialized algorithms for specialized problems. For example, for bipartite maximum cardinality matching, use the Hopcroft-Karp matching algorithm.

  • Avoid creating edges with infinite costs. Delete them or reformulate your problem.

Guidelines for algorithm developers

  • Make "negative cycles" as orthogonal to each other as possible.

  • Reuse previous solutions as a new starting point for finding negative cycles.

💡 Essential Concepts

Basic elements of a network

Definition (network)

A network is a collection of finite-dimensional vector spaces, which includes nodes and edges/arcs:

  • , where
  • where

which satisfies 2 requirements:

  1. The boundary of each edge is comprised of the union of nodes
  2. The intersection of any edges is either empty or the boundary node of both edges.

Network

  • By this definition, a network can contain self-loops and multi-edges.

  • A graph structure encodes the neighborhood information of nodes and edges.

  • Note that Python's NetworkX requires special handling of multi-edges.

  • The most efficient graph representation is an adjacency list.

  • The concept of a graph can be generalized to complex: node, edge, face...

Types of graphs

Bipartite graphs, trees, planar graphs, st-graphs, complete graphs.

Orientation

Definition (Orientation)

An orientation of an edge is an ordering of its boundary node , where

  • is called a source/initial node
  • is called a target/terminal node

👉 Note: orientation != direction

Definition (Coherent)

Two orientations to be the same is called coherent

Node-edge Incidence Matrix (connect to algebra!)

Definition (Incidence Matrix)

An matrix is a node-edge incidence matrix with entries:

  • Example:

Chain

Definition (Chain )

An edge/node chain is an /-tuple of scalar that assigns a coefficient to each edge/node, where / is the number of distinct edges/nodes in the network.

Remark (II)

A chain may be viewed as an (oriented) indicator vector representing a set of edges/nodes.

Example (II)

,

Discrete Boundary Operator

Definition (Boundary operator)

The boundary operator .

Definition (Cycle)

A chain is said to be a cycle if it is in the null-space of the boundary operator, i.e. .

Definition (Boundary)

A chain is said to be a boundary of if it is in the range of the boundary operator.

Co-boundary Operator

Definition (Co-boundary operator)

The co-boundary (or differential) operator

👉 Note

Null-space of is #components of a graph

Discrete Stokes' Theorem

  • Let
  • Conventional (integration):
  • Discrete (pairing):

Fundamental Theorem of Calculus

  • Conventional (integration):

  • Discrete (pairing):

stokes

Divergence and Flow

Definition (Divergence)

Definition (Flow)

is called a flow if , where all negative entries of (div ) are called sources and positive entries are called sinks.

Definition (Circulation)

A network is called a circulation if there is no source or sink. In other words,

Tension and Potential

Definition (Tension)

A tension (in co-domain) is a differential of a potential , i.e. .

Theorem (Tellgen's)

Flow and tension are bi-orthogonal (isomorphic).

Proof

Path

A path indicator vector of that

Theorem

[total tension on ] = [total potential on the boundary of ].

Proof

.

Cut

Two node sets and (the complement of , i.e. ). A cut is an edge set, denoted by . A cut indicator vector (oriented) of is defined as where

Theorem (Stokes' theorem!)

[Total divergence of on ] = [total across ].

Proof

.

Examples

cut

Feasibility Problems

Feasible Flow/Potential Problem

Feasible Flow Problem

  • Find a flow such that:

  • Can be solved using:

    • Painted network algorithm

    • If no feasible solution, return a "negative cut".

Feasible Potential Problem:

  • Find a potential such that:

  • Can be solved using:

    • Bellman-Ford algorithm

    • If no feasible solution, return a "negative cycle".

Examples

Genome-scale reaction network (primal)

  • : Stoichiometric matrix

  • : reactions between metabolites/proteins

  • : constraints on reaction rates

Timing constraints (co-domain)

  • : incidence matrix of timing constraint graph

  • : arrival time of clock

  • : clock skew

  • : setup- and hold-time constraints

Feasibility Flow Problem

Theorem (feasibility flow)

The problem has a feasible solution if and only if for all cuts where = upper capacity [1, p. 56].

Proof (if-part)

Let be a cut vector (oriented) of . Then

Feasibility Potential Problem

Theorem (feasibility potential)

The problem has a feasible solution if and only if for all cycles where = upper span [1, p. ??].

Proof (if-part)

Let be a path indicator vector (oriented) of . Then

Remarks

  • The only-if part of the proof is constructive. It can be done by constructing an algorithm to obtain the feasible solution.

  • could be or zero, etc.

  • could be or zero, etc.

  • could be or zero, etc.

  • could be or zero, etc.

Note: most tools require that must be zero such that the solution flow is always positive.

Convert to the elementary problem

  • By splitting every edge into two, the feasibility flow problem can reduce to an elementary one:

    • Find a flow such that

      where is the incident matrix of the modified network.

Original:

original

Modified:

modified

Convert to the elementary problem

  • By adding a reverse edge for every edge, the feasibility potential problem can reduce to an elementary one:

    • Find a potential such that

      where is the incident matrix of the modified network.

Original:

original2

Modified:

modified2

]

Basic Bellman-Ford Algorithm

function BellmanFord(list vertices, list edges, vertex source)
   // Step 1: initialize graph
   for each vertex i in vertices:
       if i is source then u[i] := 0
       else u[i] := inf
       predecessor[i] := null

   // Step 2: relax edges repeatedly
   for i from 1 to size(vertices)-1:
       for each edge (i, j) with weight d in edges:
           if u[j] > u[i] + d[i,j]:
               u[j] := u[i] + d[i,j]
               predecessor[j] := i

   // Step 3: check for negative-weight cycles
   for each edge (i, j) with weight d in edges:
       if u[j] > u[i] + d[i,j]:
           error "Graph contains a negative-weight cycle"
   return u[], predecessor[]

Example 1 : Clock skew scheduling ⏳

  • Goal: intentionally assign an arrival time to each register so that the setup and hold time constraints are satisfied.
  • Note: the clock skew is more important than the arrival time itself, because the clock runs periodically.
  • In the early stages, fixing the timing violation could be done as soon as a negative cycle is detected. A complete timing analysis is unnecessary at this stage.

Example 2 : Delay padding + clock skew scheduling ⏳

  • Goal: intentionally "insert" a delay so that the setup and hold time constraints are satisfied.

  • Note that a delay can be "inserted" by swapping a fast transistor into a slower transistor.

  • Traditional problem formulation: Find and such that

  • Note 1: Inserting delays into some local paths may not be allowed.

  • Note 2: The problem can be reduced to the standard form by modifying the network (timing constraint graph)

Four possible ways to insert delay

  • No delay:

no_delay

  • :

same_delay

  • Independent:

independent

  • :

setup_greater

Remarks (III)

  • If there exists a negative cycle, it means that timing cannot be fixed using simply this technique.

  • Additional constraints, such as , can be imposed.

Parametric Problems

Parametric Potential Problem (PPP)

  • Consider a parameter potential problem: where is a monotonic decreasing function.

  • If is a linear function where is non-negative, the problem reduces to the well-known minimum cost-to-time ratio problem.

  • If = constant, it further reduces to the minimum mean cycle problem.

Note: Parametric flow problem can be defined similarly.

Examples (III)

  • is linear :

    • Optimal clock period scheduling problem

    • Slack maximization problem

    • Yield-driven clock skew scheduling ⏳ (Gaussian)

  • is non-linear:

    • Yield-driven clock skew scheduling ⏳ (non-Gaussian)

    • Multi-domain clock skew scheduling ⏳

Examples (IV)

  • Lawler's algorithm (binary search based)

  • Howard's algorithm (cycle cancellation)

  • Young's algorithm (path based)

  • Burns' algorithm (path based)

    • for clock period optimization problem (all elements of are either 0 or 1)
  • Several hybrid methods have also been proposed

Remarks (IV)

  • Need to solve feasibility problems many times.

  • Data structures, such as Fibonacci heap or spanning tree/forest, can be used to improve efficiency

  • For multi-parameter problems, the ellipsoid method can be used.

  • Example 1: yield-driven clock skew scheduling ⏳ (c.f. lecture 5)

Example 2: yield-driven delay padding

  • The problem can be reduced to the standard form by modifying the underlying constraint graph.

Four possible way to insert delay

  • No delay:

no_delay_s

  • :

same_delay_s

  • Independent:

independent_s

  • :

setup_greater_s

Min-cost Flow/Potenial Problem

Elementary Optimal Problems

  • Elementary Flow Problem:

  • Elementary Potential Problem:

Elementary Optimal Problems (Cont'd)

  • The problems are dual to each other if

  • Since = =

  • when equality holds.

Remark (V)

  • We can formulate a linear problem in primal or dual form, depending on which solution method is more appropriate:

    • Incremental improvement of feasible solutions

    • Design variables are in the integral domain:

      • The max-flow problem (i.e. ) may be better solved by the dual method.

Linear Optimal Problems

  • Optimal Flow Problem:

  • Optimal Potential Problem:

Linear Optimal Problems (II)

By modifying the network:

  • The problem can be reduced to the elementary case [pp.275-276]

piece of cake

  • Piece-wise linear convex cost can be reduced to this linear problem [p.239,p.260]

The problem has been extensively studied and has numerous applications.

Remark (VI)

  • We can transform the cost function to be non-negative by reversing the orientation of the negative cost edges.

  • Then reduce the problem to the elementary case (or should we???)

Algorithms for Optimal Flow Problems

  • Successive shortest path algorithm

  • Cycle cancellation method

    • Iteratively insert additional minimal flows according to a negative cycle of the residual network until no negative cycles are found.
  • Scaling method

For Special Cases

  • Max-flow problem ()

    • Ford-Fulkerson algorithm: iteratively insert additional minimal flows according to an augmented path of the residual network, until no augmented paths of the residual network are found.

    • Pre-flow Push-Relabel algorithm (dual method???)

  • Matching problems ()

    • Edmond's blossom algorithm

Min-Cost Flow Problem (MCFP)

  • Problem Formulation:

  • Algorithm idea: descent method: given a feasible , find a better solution , where is positive.

General Descent Method

  • Input: , initial
  • Output: optimal opt
  • while not converged,
    1. Choose descent direction ;
    2. Choose the step size ;
    3. ;

Some Common Descent Directions

  • Gradient descent:
  • Steepest descent:
    • = (un-normalized)
  • Newton's method:
  • For convex problems, must satisfy .

Note: Here, there is a natural way to choose !

Min-Cost Flow Problem (II)

  • Let , then we have:

  • In other words, choose to be a negative cycle!

    • Simple negative cycle, or

    • Minimum mean cycle

Primal Method for MCFP

  • Input:
  • Output: optimal opt
  • Initialize a feasible and certain data structure
  • while a negative cycle found in ,
    1. Choose a step size ;
    2. If is unbounded, return UNBOUNDED;
    3. If , break;
    4. ;
    5. Update corresponding data structures
  • return OPTIMAL

Remarks (VI)

  • In Step 4, negative cycle can be found using Bellman-Ford algorithm.

  • In the cycle cancelling algorithm, is:

    • a simple negative cycle, or

    • a minimum mean cycle

  • A heap or other data structures are used for finding negative cycles efficiently.

  • Usually is chosen such that one constraint is tight.

Min-Cost Potential Problem (MCPP)

  • Problem Formulation: where is assumed to be non-negative.

  • Algorithm: given an initial feasible , find a better solution , where is positive:

Method for MCPP

  • Input:
  • Output: optimal opt
  • Initialize a feasible and certain data structure
  • while a negative cut found in ,
    1. Choose a step size ;
    2. If is unbounded, return UNBOUNDED;
    3. If , break;
    4. ;
    5. Update corresponding data structures
  • return OPTIMAL

Remarks (VII)

  • Usually is chosen such that one constraint is tight.

  • The min-cost potential problem is the dual of the min-cost flow problem, so algorithms can solve both problems.

  • In the network simplex method, is chosen from a spanning tree data structure (for linear problems only)