Presentation is loading. Please wait.

Presentation is loading. Please wait.

Memory Allocation of Multi programming using Permutation Graph By Bhavani Duggineni.

Similar presentations


Presentation on theme: "Memory Allocation of Multi programming using Permutation Graph By Bhavani Duggineni."— Presentation transcript:

1 Memory Allocation of Multi programming using Permutation Graph By Bhavani Duggineni

2 Agenda  Problem statement  Graph Construction  Relation to graph problem  NP-Hard problem  Special Properties  Depicting graph solution  Comments

3 Problem Statement  Multiprogramming – Several programs are resident in main memory at the same time – When one program executes and needs I/O, it relinquishes CPU to another program  Some important questions from the memory management viewpoint: – How does one program ask for (more) memory Allocation

4 Problem Statement  Example Problem:  In this problem we need to find the cheapest shifting of the memory requirements of 5 programs at a certain time in a multiprogramming computer. So that the order is preserved and no overlap remains. Program Number Starting Address(x i ) Length Required(L i ) 1100200 2400800 3900100 41200300 51600200

5 Graph Construction:

6 Contd..

7 Graph Construction: Program Number Starting Address(x i ) Length Required(L i ) 1100200 2400800 3900100 41200300 51600200 5 1 2 3 4

8 Relation to the graph Problem:

9 Permutation Graph:  a permutation graph is a graph whose vertices represent the elements of a permutation, and whose edges represent pairs of elements that are reversed by the permutation. Permutation graphs may also be defined geometrically, as the intersection graphs of line segments whose endpoints lie on two parallel lines.  Ex: The permutation (4,3,5,1,2) and the corresponding permutation graph

10 Permutation Graph Algorithms:  Max Independent Set corresponds to the longest increasing sequence in a permutation | O(n log n)  Max Clique : longest decreasing sequence  Coloring : chromatic number = max clique (perfect graphs)  Tree width can be solved in polynomial time.

11 Relation to the graph Problem:

12 Max clique Procedure:

13 Solution to the Problem: Using Max Clique Procedure: First we have c(1) = 1 Since 2 is connected to 1,C(2)=C1+1 So C(2)=2 And Since 3 is not connected among 1 and 2, C(3)=0 And Vertex 4 is connected to 1,3.The maximum value of the corresponding c's is 1 so C(4)=C(1)+1=2 Similarly Vertex 5 is connected to 1,2,3,4.The maximum value of the corresponding c's is 2(among 2 and 4) so C(5)=C(4)+1=3 We now know that a maximum clique is of size 3 and its highest member is the vertex 5. We search for a lower vertex connected to it whose c value is 2; this is vertex 4, etc. In this way we trace a maximum clique {1,4,5}. 5 1 23 4

14 An NP- Hard problem  It takes many years to determine all possible permutations and obtain correct order.  The problem is solvable in polynomial time on Permutation graph that is NP-complete while it is NP-Hard in general case.

15 Special Properties: Permutation graphs have several other equivalent characterizations:  A graph G is a permutation graph if and only if G is a circle graph that admits an equator, i.e., an additional chord that intersects every other chord.  A graph G is a permutation graph if and only if both G and its complement are comparability graphs.  A graph G is a permutation graph if and only if it is the comparability graph of a partially ordered set that has order dimension at most two.  If a graph G is a permutation graph, so is its complement. A permutation that represents the complement of G may be obtained by reversing the permutation representing G.

16 Depicting Graph Solution: 100 400 900 1200 1600 1 2 3 4 5 300 1000 1200 1500 1800 1 3 2 4 5 5 1 2 3 4 Program Number Starting Address(x i ) Length Required(L i ) Size of a maximum clique whose highest vertex is i 11002001 24008002 39001000 412003002 516002003

17 Comments  Many optimization problems become polynomial on permutation graphs  Representations (intersection models) based on modular decompositions.  Additional information is required to exactly determine one order from the few permutations.

18 References  S. EVEN AND A. PNUELI and A. LEMPEL :Permutation Graphs and Transitive Graphs http://lcbb4.epfl.ch/reading/graphs/permutationAndTransitiveGraphsEven.pdf  Wikipedia: http://en.wikipedia.org/wiki/Permutation_graph

19 THANK YOU


Download ppt "Memory Allocation of Multi programming using Permutation Graph By Bhavani Duggineni."

Similar presentations


Ads by Google