Download presentation

Presentation is loading. Please wait.

Published byKristopher Potter Modified about 1 year ago

1
A New and More Efficient Implementation of an Undirected Graph Component Shawn Christopher Craft The Ohio State University Department of Computer and Information Science

2
Abstract This research project entails designing, specifying, coding, testing, debugging, and documenting different implementations of an undirected graph component for the RESOLVE/C++ Component Catalog. Each version uses the same abstract model to represent the state of an undirected graph and the same kernel operations to manipulate the state of that undirected graph. The implementation strategy changes for each version. The first five versions utilize the “classic” strategies (adjacency list, adjacency matrix, and edge list) in a variety of ways. The final version employs a novel data structure that allows each operation to execute in constant time, which dominates the other strategies.

3
Component Model Edge math subtype EDGE is finite set of integer exemplar e constraint |e| = 2

4
Component Model Undirected Graph Model math subtype UNDIRECTED_GRAPH_MODEL is ( nodes: finite set of integer edges: finite set of EDGE ) exemplar g constraint there exists nb: integer where (nb > 0) (g.nodes = {n: integer where (1 <= n <= nb) (n)}) and for all e: EDGE where (e is in g.edges) (for all n: integer where (n is in e) (n is in g.nodes))

5
Component Operations Set_Number_Of_Nodes Add_Edge Remove_Edge Remove_Any_Incident_Edge Remove_Any_Edge Is_Edge Number_Of_Nodes Number_Of_Incident_Edges Number_Of_Edges

6
Classic Implementations Adjacency List Adjacency Matrix Edge List

7
New Implementation The worst case time complexity of every operation is constant “New” Adjacency Matrix using Partitionable Array

8
Partitionable Array Specify what is “interesting” Find next “interesting” thing in constant time “Needle in a Haystack” analogy All operations now in constant time

9
Undirected Graph Component We want to represent an undirected graph as a C++ class. We want the representation to be very well- defined. We want the representation to be highly reusable. We want the representation to be easily extensible.

10
Component Advantages No need to “reinvent the wheel” Well-defined and well-understood behavior More efficient project development

11
RESOLVE Discipline Component-based software Language independent Mathematical modeling Well-defined specifications Objects and operations Swapping vs. copying

12
Picture of an Undirected Graph

13
Analysis of Time Complexity

14
Analysis of Space Complexity

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google