Modeling using Nested Graph An introduction BRIDE Hadrien - ROUSSET Alban Seminex
Outline ● ● ●
Graphs in Computer Science Polygraph : A generalization of directed graph Nested Graphs ○ ○ ○ ○
●
Definition Example Pros/Cons Implementation
Usage ○ ○
Fractal PMAS : A Parallel Multi-Agent Simulator Hadara Ad-Simul : A workflow nets analysis framework
Graphs Timeline Apparition of Graph Th.
Shortest paths
Coloring problem
Leonard Euler 1736
Dijkstra 1956
Heinrich Heesch 1969
First book on Gr. Th.
Maximum flow
Finding SCC
Denes König 1936
L. R. Ford, Jr. and D.R. Fulkerson Tarjan 1956 1972
Graphs in Computer Science
● Definition ● Applications field
Graphs: Definition G = (V, E) where: ● ●
V is a set vertices and E is a set of edges.
Graphs are a structure describing relationships between objects. (The vertices denote the objects and the edges represent the relationship).
Graphs: Applications field Graphs are used in different fields such as : ●
●
Biology, Sociology, Physics, Chemistry, … Computer science ○ Big data analysis ○ Artificial Intelligence ○ Compilation ○ ...
One if not the most used data structure in computer science. Famous example: World Wide Web
Polygraphs
● A generalization of directed graph
Polygraphs ● ●
Introduced by Albert Burroni Generalize directed graph to higher dimension
0_Cell
1_Cell (0_Cell => 0_Cell)
Polygraphs
1_Path (succession of 1_Cells)
2_Cell (1_Path => 1_Path)
Polygraphs
2_Path (succession of 2_Cells)
Polygraphs Polygraph can be used to model complex systems. ● ●
●
●
0-Polygraph: A set of 0_Cell (i.e. a set of points) 1-Polygraph: A set of 1_Cell (i.e. a directed graph) ○ “State” of the modelled system 2-Polygraph: A set of 2_Cell (i.e. a set of graph transformations) ○ “Behaviours” of the modelled system 3-Polygraph: A set of 3_Cell (i.e. a set of graph transformations transformations) ○ “Reconfiguration” of the modelled system
Nested Graphs
● ● ● ●
Definition Example Pros/Cons Implementation
Nested Graphs : Definition G’ ∈ G ⇔ G = (G, A, T, L, V) where: ● ● ● ● ●
G’ ⊆ G is a set of nodes A ⊆ G × G is a set of directed arcs T : G → Γ is a typing function assigning a type to each nodes L : G → Σ is a labelling function assigning a label to each nodes V : A → Λ is a weight function assigning a value to any arc
Generalizing Nested Graphs: defining 0_Cell as Nested Graphs
Poly-Nested Graphs : Example Prey-Predator Model: ● ●
Sheep/Wolfs move inside 2D environment Each Sh.W. have vital “Force” (mod. arcs)
Poly-Nested Graphs : Example Reproduce behaviour of a Sheep: ● ●
A sheep can be duplicated by itself It produce a new Sheep with an Init. Force
Nested Graphs : Pros/Cons Pros: ● ● ● ●
●
Hierarchical structure Multi-level Abstraction Graphic representation Efficiency ○ storage ○ manipulation Very expressive
Cons: ●
Might not be intuitive for everyone
Nested Graphs : Implementation ● ●
●
●
A C++ Framework Available with : ○ vector ○ set ○ hashmap Basic functions: ○ Add/Del node(s) ○ Add/Del arc(s) ○ Get/Set neighbour(s) ○ Import/Export from/to XML Basic algorithms: ○ BFS ○ RBFS
Nested Graphs Framework is only based on the Standard library
cSub2->AddNode(cSub2Sub1);
Nested Graphs : Example Code: //The lower CGraph CGraph CGraph
level (0) nodes * cSub2Sub1Sub1 * cSub2Sub1Sub2 * cSub2Sub1Sub3
of the fractal graph on the right = new CGraph("C1"); = new CGraph("C2"); = new CGraph("C3");
//The nodes of level (1) of the fractal graph on the right CGraph * cSub2Sub1 = new CGraph("C"); cSub2Sub1->AddNode(cSub2Sub1Sub1); cSub2Sub1->AddNode(cSub2Sub1Sub2); cSub2Sub1->AddNode(cSub2Sub1Sub3); CArc * a3 = new CArc("a3",cSub2Sub1Sub1, cSub2Sub1Sub2,6); CArc * a4 = new CArc("a4",cSub2Sub1Sub2, cSub2Sub1Sub3,4); CArc * a5 = new CArc("a5",cSub2Sub1Sub3, cSub2Sub1Sub1,9); cSub2Sub1->AddArc(a3); cSub2Sub1->AddArc(a4); cSub2Sub1->AddArc(a5); //The left fractal graph of level (2) CGraph * cSub2 = new CGraph("Sub2");
//The main graph level (3) CGraph * cGraph = new CGraph("MainGraph"); cGraph->AddNode(cSub1); cGraph->AddNode(cSub2); CArc * a6 = new CArc("a6",cSub1,cSub2,1); CArc * a7 = new CArc("a7",cSub2,cSub1,2); cGraph->AddArc(a6); cGraph->AddArc(a7); //Export as dot cGraph->SaveAsDot("graph.dot");
You can also contribute!
Information Implementation available on GitHub under GNU licence : ●
https://github.com/LoW12/FractalGraph
Usage
● Fractal PMAS ● Hadara Ad-Simul
Fractal PMAS ●
●
Use of CGraph at 2 levels: ○ Modelisation of agents ○ Representation of Distribution and Load Balancing CGraph is coupled with a parallel graph partitioning framework (Zoltan) Making large scale simulations
███████╗██████╗ ███╗ ███╗ █████╗ ███████╗ ██╔════╝██╔══██╗████╗ ████║██╔══██╗██╔════╝ █████╗ ██████╔╝██╔████╔██║███████║███████╗ ██╔══╝ ██╔═══╝ ██║╚██╔╝██║██╔══██║╚════██║ ██║ ██║ ██║ ╚═╝ ██║██║ ██║███████║ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝
Fractal PMAS
Fractal PMAS ●
Simulation with: ○ more than 600 000 nodes
Work published in PDP’2016
Hadara Ad-Simul ●
●
●
Implementation Based on CGraph ○ Workflow nets are Graphs ○ Support hierarchical workflows Generate workflow nets (large scale) ○ Benchmarking Reduce workflow nets (large scale) ○ Semi-decide Generalised Soundness
Thanks for your attention Any questions ?