25
Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Embed Size (px)

Citation preview

Page 1: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Random Graph Generator

University of NE @OmahaCS 8910 – Final Research Project Presentation

Professor: Dr. ZhuPresented: December 8, 2010

By: Hanh Tran

Page 2: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Overview

• Why RG Generator?• Basic RG Concepts• Implementation Features• Randomness Verification• Degree Distribution Example• Convergence Example• Results & Analysis• Summary

Page 3: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Why Choose RG Generator

• Internet, WWW, social networks, scientific-collaboration networks

• Random Graphs are used as models• Few RG generators available (commercial

product/open source)• Very specific (test new algorithm), complex,

unfriendly interface

Page 4: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Basic RG Concepts

• Directed vs. Undirected• Weighted vs. Non-weighted• Minimum Edge Connected Graph

Page 5: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Basic RG Concepts (2)

• Complete Graph

Page 6: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Basic RG Concepts (3)

• Minimum < Sparse < Dense < Complete

• Degree Distribution - # nodes w/ certain # of edges

Page 7: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Implementation Features

• Minimum Graph = (n – 1) edges• Sparse Graph = has at least as many as (n – 1) edges,

but no more than (n2+n-2)/4 edges• Dense Graph = has at least as many as (n2+n-2)/4

edges, but no more than n (n – 1)/2 edges

• Complete Graph = n (n – 1)/2 edges

Page 8: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Randomness Verification

Random network – node linkages follow a Poisson distribution in a bell shape.

5 6 7 8 9 10 11 12 13 14 15 16 17 180

2

4

6

8

10

12

14

16

Sparse Graph w/ 100 nodes

Series1

Number of Edges

Num

ber

of N

odes

w/

Edge

Cou

nt

Page 9: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Randomness Verification (2)

5442 5479 5496 5510 5524 5538 5552 5566 5580 5594 5608 5622 5636 5650 5664 5678 5692 5706 5720 5734 5748 5762 5778 58090

20

40

60

80

100

120Dense Graph w/ 10000 nodes

RG Graph Data

Normal Distribution

Number of Edges

Num

ber

of N

odes

w/

Edge

Cou

nt

Page 10: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution

• Degree Distribution = P(k) = nk/n

Where nk = # nodes w/ degree k, n = # nodes in network

• Example 1.

Input: n = 10, type = minimum, degree = 5, distribution = 70%

Output:Minimum Graph contains 9 max edges.Complete Graph contains 45 max edges.Sparse Graph contains greater than 9 but less than 27 edges. Dense Graph contains greater or equal 27 but less than 45 edges. *********************************************************We will create 9 edges for this Minimum edge graph.*********************************************************

Page 11: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution (2)

Initial Frequency ArrayNode 0 has 2 edge(s).Node 1 has 3 edge(s).Node 2 has 2 edge(s).Node 3 has 3 edge(s).Node 4 has 1 edge(s).Node 5 has 2 edge(s).Node 6 has 2 edge(s).Node 7 has 1 edge(s).Node 8 has 1 edge(s). Node 9 has 1 edge(s). Currently 0 nodes have 5 or more number of edges.That represents 0 %... Adding more edges.

Page 12: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution (3)After adding an edge between nodes 0 and 9, the results are:

Frequency ArrayNode 0 has 3 edge(s).Node 1 has 3 edge(s).Node 2 has 2 edge(s).Node 3 has 3 edge(s).Node 4 has 1 edge(s).Node 5 has 2 edge(s).Node 6 has 2 edge(s).Node 7 has 1 edge(s).Node 8 has 1 edge(s).Node 9 has 2 edge(s).

Page 13: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution (4)After randomly selecting nodes 0 and 3, which already have an edge, the results are unchanged:

Frequency ArrayNode 0 has 3 edge(s).Node 1 has 3 edge(s).Node 2 has 2 edge(s).Node 3 has 3 edge(s).Node 4 has 1 edge(s).Node 5 has 2 edge(s).Node 6 has 2 edge(s).Node 7 has 1 edge(s).Node 8 has 1 edge(s).Node 9 has 2 edge(s).

Page 14: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution (5)After adding an edge between nodes 8 and 9, the results are:

Frequency ArrayNode 0 has 3 edge(s).Node 1 has 3 edge(s).Node 2 has 2 edge(s).Node 3 has 3 edge(s).Node 4 has 1 edge(s).Node 5 has 2 edge(s).Node 6 has 2 edge(s).Node 7 has 1 edge(s).Node 8 has 2 edge(s).Node 9 has 3 edge(s).

Page 15: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Degree Distribution (6)... After 29 more iterations, the results are:

Frequency ArrayNode 0 has 5 edge(s).Node 1 has 5 edge(s).Node 2 has 5 edge(s).Node 3 has 5 edge(s).Node 4 has 2 edge(s).Node 5 has 4 edge(s).Node 6 has 4 edge(s).Node 7 has 5 edge(s).Node 8 has 6 edge(s).Node 9 has 5 edge(s). 70% Achieved.We have 23 edges in this Sparse Graph.

Page 16: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Distributed Agreement

• Distributed agreement has been used in numerous areas:• Network communication•Computer architecture• operating systems• software engineering

Page 17: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Distributed Agreement

• Some examples:• Byzantine agreement in flight control systems• Multi-value consensus in critical applications• commit protocols in database transactions• Leader election from a number of hosts• Load balancing among a number of hosts• Clock synchronization among hosts

Page 18: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Distributed Agreement

• General approach to reach agreement:• Broadcast: Each node broadcasts its value to neighbors• Collect: Each node forms a multiset of values• Average: Average the values received.

• It is hoped that agreement is reached when the above round is repeated a sufficient number of times.

Page 19: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Conditions for agreement

• Convergence: All hosts eventually halt with values that are within a predefined tolerance of each other

• Validity: The agreed upon values are within the range of initial values before the agreement process started.

Page 20: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Application of RG in Distributed Agreement

• Generation of RG can be used as a test-bed for:• Simulating the distributed agreement process.• Validating the process of distributed alogorithms.• Better intuitive understanding of agreement process• Comparing the simulation results with mathematical results.• How fast convergence takes place in a realistic environment

Page 21: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Example of distributed agreement

• How fast do the node values come to a consensus?• Example 2.

Input: n = 6, type = minimum, convergence = on

Output: We will create 5 edges for this Minimum edge graph.

Adjacency Matrix: n 0 1 2 3 4 5

0 0 1 0 0 0 0

1 0 0 1 0 1 1

2 0 0 0 1 0 0

3 0 0 0 0 0 0

4 0 0 0 0 0 0

5 0 0 0 0 0 0

Page 22: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Convergence (2)Minimum Graph of 6 nodes, with random values.

0 31

1 43

5 60

2 65

3 98

4 37

Page 23: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Convergence (3)

INITIAL value diameter: 98 – 31 = 67After ROUND 1, diameter of values becomes 44 converged by: (67-44)/67 = 34% After ROUND 2, diameter of values becomes 32 converged by : (44-32)/44 = 27%After ROUND 3, diameter of values becomes 24After ROUND 4, diameter of values becomes 18After ROUND 5, diameter of values becomes 14After ROUND 6, diameter of values becomes 11After ROUND 7, diameter of values becomes 09

Overall after 7 rounds the values converged by : (67-09)/67 = 87%

If one expects to have 100% convergence, this process should continue until the diameter values becomes 0.

Page 24: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Some general results noticed

• Randomness = larger networks with higher connectivity produce a clearer bell-shape distribution.

• Degree Distribution = no clear impact based on network size.

• Network diameter seems to have more impact on the number of rounds to reach the desired convergence rate.

• Dense connectivity implies faster convergence in terms of number of rounds needed.

• Convergence rate and number of rounds to reach a desired level of convergence highly depends on the initial distribution of values.

Page 25: Random Graph Generator University of NE @Omaha CS 8910 – Final Research Project Presentation Professor: Dr. Zhu Presented: December 8, 2010 By: Hanh Tran

Summary

• Basic framework for generating random networks with some key features, DD and Convergence.

• Future implementation of directed and weighted edges will provide additional data pertaining to convergence speed.

• Test the distribution agreement in presence of failures (such as link failures).