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

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

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

Page 1: 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.

Page 2: Modeling and Evaluation with Graph Mohammad 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

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

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

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

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.

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

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

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

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

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

7SHORTEST PATHS

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

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

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

9

Dijkstra' s algorithm

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

10Label-Correcting Algorithm

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

11Label-Correcting Algorithm (continue)

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

12Label-Correcting Algorithm (continue)

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

13Label-Correcting Algorithm (continue)

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

14Label-Correcting Algorithm (continue)

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

15Label-Correcting Algorithm (continue)

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

16Label-Correcting Algorithm (continue)

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

17OPTIMALITY CONDITIONS of Label-Correcting Algorithm

they must satisfy the following necessary optimality conditions

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

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

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

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.

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

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.

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

21MAXIMUM FLOWS (continue)

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

22MAXIMUM FLOWS (continue)

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

23Finding Minimum Cuts Using Shortest Paths

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

24MINIMUM COST FLOWS APPLICATIONS

Distribution Problems

Min energy routing

Resource allocation

TCP protocol

MAC Layer Fair Rate Control

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

25MINIMUM COST FLOWS

shortest path problem contains no arc capacities

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

26MINIMUM COST FLOWS

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

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

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

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

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

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.

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

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.

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

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

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

32RELAXATION ALGORITHM

a more recent vintage minimum cost flow algorithm

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

33RELAXATION ALGORITHM(continue)

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

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

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.

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

؟”