Budapest University of Technology and Economics Adaptive Graph Pattern Matching for Model Transformations using Model-sensitive Search Plans Gergely Varró.

Slides:



Advertisements
Similar presentations
A R EVISIT TO THE P RIMAL -D UAL B ASED C LOCK S KEW S CHEDULING A LGORITHM Min Ni and Seda Ogrenci Memik EECS Department, Northwestern University.
Advertisements

Ch. 12 Routing in Switched Networks
Algorithm Design Techniques
AI Pathfinding Representing the Search Space
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
ECE 667 Synthesis and Verification of Digital Circuits
Introduction to Computer Science 2 Lecture 7: Extended binary trees
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
Query Optimization of Frequent Itemset Mining on Multiple Databases Mining on Multiple Databases David Fuhry Department of Computer Science Kent State.
Label Placement and graph drawing Imo Lieberwerth.
Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method.
Branch & Bound Algorithms
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
CS171 Introduction to Computer Science II Graphs Strike Back.
Lectures on Network Flows
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 12: Expert Systems Design Examples
Operation Research Chapter 3 Simplex Method.
Chapter 3 The Greedy Method 3.
Branch and Bound Searching Strategies
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Chapter 9: Greedy Algorithms The Design and Analysis of Algorithms.
Chapter 9 Greedy Technique Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 10: Algorithm Design Techniques
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
1 Efficient Discovery of Conserved Patterns Using a Pattern Graph Inge Jonassen Pattern Discovery Arwa Zabian 13/07/2015.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Query Processing Presented by Aung S. Win.
Escaping local optimas Accept nonimproving neighbors – Tabu search and simulated annealing Iterating with different initial solutions – Multistart local.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Operations Research Assistant Professor Dr. Sana’a Wafa Al-Sayegh 2 nd Semester ITGD4207 University of Palestine.
EVENT MANAGEMENT IN MULTIVARIATE STREAMING SENSOR DATA National and Kapodistrian University of Athens.
1 MDWE'2008, Toulouse, France, September 30, 2008 A Comparative Analysis of Transformation Engines for User Interface Development Juan Manuel González.
1 Time Analysis Analyzing an algorithm = estimating the resources it requires. Time How long will it take to execute? Impossible to find exact value Depends.
May 2004 Department of Electrical and Computer Engineering 1 ANEW GRAPH STRUCTURE FOR HARDWARE- SOFTWARE PARTITIONING OF HETEROGENEOUS SYSTEMS A NEW GRAPH.
Chapter 12 Recursion, Complexity, and Searching and Sorting
CSc 453 Final Code Generation Saumya Debray The University of Arizona Tucson.
Analysis of algorithms Analysis of algorithms is the branch of computer science that studies the performance of algorithms, especially their run time.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 9 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
Union-find Algorithm Presented by Michael Cassarino.
Lecture 3: Uninformed Search
Budapest University of Technology and Economics Technical University of Darmstadt Real-Time Systems Lab Benchmarking for Graph Transformation Gergely Varró.
Column Generation By Soumitra Pal Under the guidance of Prof. A. G. Ranade.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
Assignments and matchings Chapter 12 Presented by Yorai Geffen.
1 Greedy Technique Constructs a solution to an optimization problem piece by piece through a sequence of choices that are: b feasible b locally optimal.
Budapest University of Technology and Economics Department of Computer Science and Information Theory 1 Graph Transformation in Relational Databases Gergely.
SSQSA present and future Gordana Rakić, Zoran Budimac Department of Mathematics and Informatics Faculty of Sciences University of Novi Sad
The Interpreter Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Top-K Generation of Integrated Schemas Based on Directed and Weighted Correspondences by Ahmed Radwan, Lucian Popa, Ioana R. Stanoi, Akmal Younis Presented.
APEX: An Adaptive Path Index for XML data Chin-Wan Chung, Jun-Ki Min, Kyuseok Shim SIGMOD 2002 Presentation: M.S.3 HyunSuk Jung Data Warehousing Lab. In.
1 JOB SEQUENCING WITH DEADLINES The problem is stated as below. There are n jobs to be processed on a machine. Each job i has a deadline d i ≥ 0 and profit.
Lecture 12 Huffman Algorithm. In computer science and information theory, a Huffman code is a particular type of optimal prefix code that is commonly.
Onlinedeeneislam.blogspot.com1 Design and Analysis of Algorithms Slide # 1 Download From
An Exact Algorithm for Difficult Detailed Routing Problems Kolja Sulimma Wolfgang Kunz J. W.-Goethe Universität Frankfurt.
Branch and Bound Searching Strategies
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Best-first search is a search algorithm which explores a graph by expanding the most promising node chosen according to a specified rule.
Lecture 3: Uninformed Search
Greedy Technique.
The minimum cost flow problem
Instruction Scheduling Hal Perkins Summer 2004
Graphs & Graph Algorithms 2
Objective of This Course
Searching for Solutions
Instruction Scheduling Hal Perkins Autumn 2005
CMPT 225 Lecture 16 – Heap Sort.
Presentation transcript:

Budapest University of Technology and Economics Adaptive Graph Pattern Matching for Model Transformations using Model-sensitive Search Plans Gergely Varró Dániel Varró Katalin Friedl

2 Budapest University of Technology and Economics Talk overview Introduction & GT PM techniques Approach overview Model-sensitive search plans Adaptive PM

3 Budapest University of Technology and Economics Introduction Common problem to be solved by model transformation tools: –Efficient query and manipulation of complex graph-based patterns One possible solution: –Graph transformation

4 Budapest University of Technology and Economics Metamodeling Attribute CF Ref EO UF ** 1 ModelElement NamespaceFeature Column TableSchema ClassPackage UniqueKey PKey 1 ClassAssociation At most one Inheritance Instance model CWM Metamodel Slot r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Arbitrary Object Multiplicity constraint Link

5 Budapest University of Technology and Economics Graph transformation rule s:Schema r1:Refrn:Ref tn:Table p:Package Left-Hand Side Right-Hand Side c:Class eo1:EO s:Schema r1:Refr2:Ref t:Table p:Package c:Class eo1:EO tpk:PKeytid:Column eo2:EO eo3:EO cf:CF uf:UF ClassRule Negative applicationc ondition LHSRHS

6 Budapest University of Technology and Economics Pattern matching phase LHSRHS s:Schema r1:Refrn:Ref tn:Table p:Packagec:Class eo1:EO s:Schema r1:Refr2:Ref t:Table p:Package c:Class eo1:EO tpk:PKeytid:Column eo2:EO eo3:EO cf:CF uf:UF ClassRule r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO

7 Budapest University of Technology and Economics Updating phase id2:Column t2:Table uf:UF LHSRHS s:Schema r1:Refrn:Ref tn:Table p:Packagec:Class eo1:EO s:Schema r1:Refr2:Ref t:Table p:Package c:Class eo1:EO tpk:PKeytid:Column eo2:EO eo3:EO cf:CF uf:UF ClassRule r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO pk2:PKey eo6:EO eo5:EO eo4:EO r2:Ref

8 Budapest University of Technology and Economics Talk overview Introduction & GT PM techniques Approach overview Model-sensitive search plans Adaptive PM

9 Budapest University of Technology and Economics Practical consideration Most critical step: pattern matching Simplification: without NAC s:Schema r1:Refrn:Ref tn:Table p:Package c:Class eo1:EO ClassRule LHS s:Schema r1:Refr2:Ref t:Table p:Package c:Class eo1:EO tpk:PKeytid:Column eo2:EO eo3:EO cf:CF uf:UF RHS

10 Budapest University of Technology and Economics Pattern matching techniques Style –Interpreted: AGG, VIATRA underlying PM engine –Compiled: Fujaba, GReAT, PROGRES directly executed as a C or Java code (no PM engine) Base algorithm –Constraint satisfaction: AGG, VIATRA variables + constraints –Local search: Fujaba, GReAT, PROGRES step-by-step extension of the matching

11 Budapest University of Technology and Economics Traditional approach I. Pattern matching strategy –defined in design/compile time –single search plan –based on multiplicity and type restrictions e.g. at-most-one multiplicity precedes arbirtrary multiplicity Fixed implementation –nested-loops –in Java, C,... s:Schema r1:Ref p:Package c:Class eo1:EO Rule LHS Design/Compile time c p s Search plan Search sequence frequently used & efficient solution order of traversal in the search plan multiplicity & type restrictions

12 Budapest University of Technology and Economics Traditional approach II. s:Schema r1:Ref p:Package c:Class eo1:EO Rule LHS Design/Compile time Execution time Search space tree c p s r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO c p s Model Search plan Search sequence Search space tree (SST) –Search space traversed according to a specific search plan –Contains all decisions made during pattern matching

13 Budapest University of Technology and Economics Talk overview Introduction & GT PM techniques Approach overview Model-sensitive search plans Adaptive PM

14 Budapest University of Technology and Economics Model-sensitive search plans Rule Design/Compile time Search plan 1 Search plan 2 Search plan 3 Typical model 1 Typical model 2 Typical model 3

15 Budapest University of Technology and Economics Adaptive PM approach Rule Design/Compile time Execution time Current model Search plan 1 Search plan 2 Search plan 3 Typical model 1 Typical model 2 Typical model 3 Strategy selection Search space tree

16 Budapest University of Technology and Economics Talk overview Introduction & GT PM techniques Approach overview Model-sensitive search plans Adaptive PM

17 Budapest University of Technology and Economics Instance model with statistics Statistical data –based on rules –collected from instance models Example: s:Schema r1:Ref p:Package c:Class eo1:EO Rule LHS r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Typical model 1 # Schema Package Class EO(Package,Class) Ref(Package,Schema) Schema Inheritance Package

18 Budapest University of Technology and Economics Search graph s:Schema r1:Ref p:Package c:Class eo1:EO Rule LHS cps Search graph Edge from the starting node to another node –Iteration over all objects in the model of the corresponding type Edge between non-starting nodes –When source pattern node is already matched –Navigation along the corresponding pattern edge towards the unmatched (target) pattern node Starting node

19 Budapest University of Technology and Economics Weighted search graph cps Search graph 1 cps r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Typical model 1 Schema 1 Package 3 Class 3 EO(Package,Class) 3 Ref(Package,Schema) 1 #Ref(Package,Schema)/#Package = 1/3 = 0.33#Ref(Package,Schema)/#Schema = 1/1 = 1 Edge weight –average branching factor of a possible SST at the level, when the given edge is selected for navigation

20 Budapest University of Technology and Economics Search plan Weighted search graph 1 cps cps Search tree 1 cps Search plan 1 Algorithm 1 Algorithm 2

21 Budapest University of Technology and Economics Search plan cps Search plan 1 Estimated search space tree s p c r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Typical model 1 w(P) =w(P) = 1w(P) = 1 + 1*1w(P) = 1 + 1*1 + 1*1*1 = 3 Estimated number of traversed nodes in SST Properties of the minimal search plan –SST optimal in size –first-fail principle

22 Budapest University of Technology and Economics Algorithm 1 Given: –Search graph Goal: –Low cost search tree Chu-Liu / Edmonds algorithm –Relatively simple greedy algorithm –Spanning tree in a weighted directed graph –Optimality guaranteed, if cost function is the sum of edge weights ! + Fast

23 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm I. Discard edges entering the starting node Weighted search graph 1 cps

24 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm II. For each other node, select the incoming edge with the smallest weight. Let the selected n-1 edges be the set S. Weighted search graph 1 cps

25 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm III. For each cycle formed, contract the nodes of the cycle into a pseudo-node k, and Modify the weight of each edge entering node j of the cycle from some node i outside the cycle. Weighted search graph 1 cps M = min(1,0.33) = 0.33 c(i,k) = c(i,j) – [c(x(j),j)-M]

26 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm IV. For each pseudo-node, select the entering edge, which has the smallest weight. Go to the previous step with the contracted graph. Weighted search graph 1 cps

27 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm V. For each cycle formed, contract the nodes of the cycle into a pseudo-node k, and Modify the weight of each edge entering node j of the cycle from some node i outside the cycle. Weighted search graph 1 c M = min(1,0.67) = 0.67 c(i,k) = c(i,j) – [c(x(j),j)-M]

28 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm VI. For each pseudo-node, select the entering edge, which has the smallest weight. Go to the previous step with the contracted graph. Weighted search graph 1 c

29 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm VII. No cycles Restore the consistency of edges in contracted nodes. Weighted search graph 1 c

30 Budapest University of Technology and Economics Chu-Liu / Edmonds algorithm VIII. Restore the consistency of edges in contracted nodes. Weighted search graph 1 cps Search tree 1

31 Budapest University of Technology and Economics Algorithm 2 Set the label of the smallest tree edge leaving S to the value of the counter. Increment the counter, and add the target node of the selected edge to S. Repeat these steps until S contains all nodes of the graph. cps Search tree 1 counter = 1, S = {0}counter = 2, S = {0,s}counter = 3, S = {0,s,p}counter = 4, S = {0,s,p,c} 32 1 Search plan 1 Simple greedy algorithm

32 Budapest University of Technology and Economics Additional notes NACs –general rule: checked after a matching found –simple checks (e.g. cardinality check) when shared node is processed during the traversal of LHS –NAC pattern ~ LHS pattern  no problem Completion of partially matched patterns –several starting nodes in Algorithms 1 and 2 –search tree  forest rooted at starting nodes –all other nodes are reachable on tree edges

33 Budapest University of Technology and Economics Model-sensitive search plan generation r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Typical model 1 cps cps Search plan 2 Search plan 1 Same as the search plan of the traditional approach r2:Ref s2:Schema p1:Package p2:Package eo1:EO Typical model 2 s1:Schema r1:Ref c1:Class

34 Budapest University of Technology and Economics Talk overview Introduction & GT PM techniques Approach overview Model-sensitive search plans Adaptive PM

35 Budapest University of Technology and Economics Adaptive PM implementation cost() : –calculates the cost of the search plan based on the current instance model –invoked on every strategies before each pattern matching match() : –pattern matching implementation –invoked only on the strategy with the smallest cost Strategy Strategy FromModel1 Strategy FromModel2 cost() match()

36 Budapest University of Technology and Economics Runtime behaviour I. cps cps Search plan 2Search plan 1 Search space tree w(P1) = 3w(P2) = 7 r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Typical model 1 s p c c p s

37 Budapest University of Technology and Economics Runtime behaviour II. cps cps Search plan 2Search plan 1 r2:Ref s2:Schema p1:Package p2:Package eo1:EO Typical model 2 s1:Schema r1:Ref c1:Class Search space tree s p c c p s w(P1) = 4.5w(P2) = 2.5

38 Budapest University of Technology and Economics Runtime behaviour III. cps cps Search plan 2Search plan 1 Search space tree w(P1) = 0w(P2) = 6 eo1:EO c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO Model 3 s p c c p s Immediate PM failure detection

39 Budapest University of Technology and Economics Pros and contras Resource related + time: smaller execution time during pattern matching –time: extra computation for cost calculation –storage: small amount of additional (statistical) data Application area related + when only one matching is needed + first-fail principle  early detection of PM failure + manually created (or tool provided) search plans can be used –search plan generation algorithm: not necessarily optimal –estimated and executed SST may differ + estimated SST better for the worst case

40 Budapest University of Technology and Economics Future work Topics not discussed –Java implementation of search plans Todo list –Quantitative measurements for assessing the performance of the approach –Algorithm for finding an optimal search plan Thanks for your kind attention. Questions, comments, remarks?

41 Budapest University of Technology and Economics Search graph s:Schema r1:Ref p:Package c:Class eo1:EO Rule LHS cps cps cps

42 Budapest University of Technology and Economics Instance model r1:Ref eo1:EO s2:Schema c1:Class p1:Package p2:Package c2:Class eo2:EO c3:Class eo3:EO