Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.

Post on 12-Jan-2016

213 views 0 download

Tags:

Transcript of Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.

Modeling and Evaluation with GraphMohammad Khalily Dermany

Islamic Azad University, Khomein branch.

2Application

Graphs useful mathematical objects for representing many physical systems.

Communication

systematical analyze of electrical circuits

Relationship of data

Distributed Computing on a multi-Processor Computers

Cloud computing

Other science fields

3basic questions

Shortest path problem

Maximum flow problem

Minimum cost flow problem

Assignment problem

Transportation problem

Circulation problem

Convex cost flow problems

Generalized flow problems

Multicommodity flow problems

Minimum spanning tree problem

4Notation

Let G = (N, A) be a directed network defined by a set N of n nodes and a set A of m directed arcs. Each arc (i, j)EA has an associated cost Cij that denotes the cost per unit flow on that arc. We assume that the flow cost varies linearly with the amount of flow. We also associate with each arc (i, j)EA a capacity Uij that denotes the maximum amount that can flow on the arc and a lower bound lij that denotes the minimum amount that must flow on the arc. We associate with each node iEN an integer number b(i) representing its supply/demand. If b(i) > 0, node i is a supply node; if b(i) < 0, node i is a demand node with a demand of - b(i); and if b(i) = 0, node i is a transshipment node.

5Definition

Tails and Heads

Degrees

Adjacency List

Multiarcs and Loops

Subgraph

Walk

Directed Walk

Path: A path is a walk without any repetition of nodes.

Directed Path

Cycle

Acyclic Graph

Connectivity

Strong Connectivity

Cut

6Various Types of Shortest Path Problems

1. Finding shortest paths from one node to all other nodes when arc lengths are nonnegative

2. Finding shortest paths from one node to all other nodes for networks with arbitrary arc lengths

3. Finding shortest paths from every node to every other node

4. Various generalizations of the shortest path problem

7SHORTEST PATHS

8iterative algorithmic approaches

label setting (Dijkstra' s algorithm O(n2))

several versions of Dijkstra's algorithm that improve upon its worst-case complexity.

implementations uses a heap (or priority queue) data structure

Knapsack Problem

label correcting (O(n2C) C on the maximum absolute value of any arc length)

reduces the distance label of one node at each iteration by considering only local information, namely the length of the single arc and the current distance labels of its incident nodes.

flexibility

Label-setting algorithms designate one label as permanent (optimal) at each iteration. In contrast, label-correcting algorithms consider all labels as temporary until the final step, when they all become permanent.

modified versions

9

Dijkstra' s algorithm

10Label-Correcting Algorithm

11Label-Correcting Algorithm (continue)

12Label-Correcting Algorithm (continue)

13Label-Correcting Algorithm (continue)

14Label-Correcting Algorithm (continue)

15Label-Correcting Algorithm (continue)

16Label-Correcting Algorithm (continue)

17OPTIMALITY CONDITIONS of Label-Correcting Algorithm

they must satisfy the following necessary optimality conditions

18ALL-PAIRS SHORTEST PATH PROBLEM

repeated shortest path algorithm

If S(n, m, C) denotes the time needed to solve a shortest path problem

All-pairs shortest path problem in O(n S(n, m, C))time.

all-pairs label-correcting algorithm

especially well suited for dense networks

Floyd-Warshall algorithm

19MAXIMUM FLOWS

The maximum flow problem and the shortest path problem are complementary

Shortest path problems model arc costs but not arc capacities; maximum flow problems model capacities but not costs.

we wish to send as much flow as possible between two special nodes, a source node s and a sink node t, without exceeding the capacity of any arc.

The max-flow min-cut theorem establishes an important correspondence between flows and cuts in networks.

Indeed, as we will see, by solving a maximum flow problem, we also solve a complementary minimum cut problem: From among all cuts in the network that separate the source and sink nodes, find the cut with the minimum capacity.

20MAXIMUM FLOWS (continue)

s-t cut: a cut is a partition of the node set N into two subsets Sand S = N - S;

Capacity of an s-t cut: sum of the capacities of the forward arcs in the cut

Minimum cut: an s-t cut whose capacity is minimum among all s-t cuts as a minimum cut.

21MAXIMUM FLOWS (continue)

22MAXIMUM FLOWS (continue)

23Finding Minimum Cuts Using Shortest Paths

24MINIMUM COST FLOWS APPLICATIONS

Distribution Problems

Min energy routing

Resource allocation

TCP protocol

MAC Layer Fair Rate Control

25MINIMUM COST FLOWS

shortest path problem contains no arc capacities

26MINIMUM COST FLOWS

27potential of node

(i) as the potential of node I

(i) is the linear programming dual variable corresponding to the mass balance constraint of node i.

reduced cost of an arc (i, j) as = cij - (i) + (j).

28potential of node

the node potentials do not change the shortest path between any pair of nodes k and I, since the potentials increase the length of every path by a constant amount (l) - (k).

29

SUCCESSIVE SHORTEST PATH ALGORITHM PRIMAL-DUAL ALGORITHM

It maintains a solution x that satisfies the nonnegativity and capacity constraints, but violates the mass balance constraints of the nodes.

30SUCCESSIVE SHORTEST PATH ALGORITHM PRIMAL-DUAL ALGORITHM(continue)

A pseudofllow is a function x: A -> R+ satisfying only the capacity and nonnegativity constraints; it need not satisfy the mass balance constraints. For any pseudoflow x, we define the imbalance of node i as

If e(i) > 0 for some node i, we refer to e(i) as the excess of node i; if e(i) <0, we call - e(i) the node's deficit. We refer to a node i with e(i) = 0 as balanced.

31SUCCESSIVE SHORTEST PATH ALGORITHM PRIMAL-DUAL ALGORITHM(continue)

Let E and D denote the sets of excess and deficit nodes in the network.

if the network contains an excess node, it must also contain a deficit node.

classical in the sense that researchers developed them in the 1950s and 1960s

32RELAXATION ALGORITHM

a more recent vintage minimum cost flow algorithm

33RELAXATION ALGORITHM(continue)

each flow variable Xij appears twice: once with a coefficient of - (i) and the second time with a coefficient of (j).

34RELAXATION ALGORITHM(continue)

(1) if > 0, we set Xij = 0;

(2) if < 0, we set Xij = uij;

(3) if = 0, we can set xij to any value between 0 and Uij.

؟”