Write A C Program That Uses The “Pebble Game” Technique To Test If An Input Graph Is Minimally Rigid (In Two Dimensions). The First Line Of The Input Will Be N, The Number Of Vertices.
INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
Requirements:
- Write A C Program That Uses The “Pebble Game” Technique To Test If An Input Graph Is Minimally Rigid (In Two Dimensions). The First Line Of The Input Will Be N, The Number Of Vertices. N Will Not Exceed 100. Each Of The Remaining 2n – 3 Lines Will Contain Two Values In The Range 0 . . . N – 1 To Designate An Undirected Edge. (Self-Loops And Parallel Edges Will Not Be Included.) Each Input Line Should Be Echoed To The Output Before Being Processed. The Last Line Of Your Output Should Be Either 1) An Indication That The Graph Is Minimally Rigid (“Laman”) Or 2) An Indication That The Last Edge Processed Is “Redundant” Along With The Set Of Vertices Giving The Rigid Subgraph For The Redundant
- If A Pebble Is Moved, You Should Output The Vertices On The Pebble’s
- Submit Your C Program On Canvas 10:45 Am (Section 004) Or 1:45 Pm (Section 003) On December 3. Comments At The Beginning Of The Source File Should Include: Your Name, Your ID Number, And The Command Used To Compile Your Code On Omega (5 Point Penalty For Non-Compliance).
Getting Started:
- The Input Is Easily Read By Using Scanf(). Do Not Prompt For A File Name!
- The Following Bar-And-Joint System Has N = 6 Vertices, 2n – 3 = 9 Edges, And Is Initialized With Two Pebbles At Each Vertex:
- The First Rule Of The Pebble Game Changes An Undirected Edge Between Vertices X And Y To A Directed Edge From X To Y. Before Applying This Rule, Both Vertices Must Have Two Pebbles. After Applying This Rule, X Will Have Just One Pebble And Y Will Still Have Two
- The Second Rule Allows A Pebble To Be Moved Against The Direction Of A Path. I.E. The Path
- To Analyze Rigidity, The Two Rules May Be Applied In Any Order With The Goal Of Making All Edges
- The Following Characterizations Of Laman Give An Algorithmically Expensive Way Of Testing Rigidity:
The Edges Of A Graph G = (V, E) Are Independent (Non-Redundant) In Two Dimensions If And Only If No Subgraph G´ = (V´,
E´) (With N´ Vertices) Has More Than 2n´ - 3 Edges.
(Corollary) A Graph With 2n - 3 Edges Is Rigid In Two Dimensions If And Only If No Subgraph G´ (With N´ Vertices) Has More Than 2n´ - 3 Edges.
- Jacobs And Hendrickson Further Developed The “Pebble Game” Technique To Test Rigidity In O⎛⎜ N2⎞⎟ Time:
Place Two Pebbles At Each Vertex. For Each Input Edge {X Y}
Attempt To Get Two Pebbles (Four Total) At Vertices X And Y. This May Be Done Using BFS (Or DFS) To Find A Directed Path To A Vertex (Other Than X Or Y) With A Pebble. After
The Vertex Is Found, The Path Must Be Reversed. If Four Pebbles Are Achieved
Use One Pebble On X To Record The Directed Edge X ® Y. Else
// Only Three Pebbles Were Achieved For {X Y}.
{X Y} Is A Redundant Edge.
The Vertices Reached During The Last Search Induce A Rigid Subgraph. Exit(0)
// All Edges Have Been Directed . . . Graph Is Minimally Rigid
8.Due To The Limited Number Of Edges (2n - 3) And The Characteristics Of The Pebble Game, Only A Simple Table Is Needed To Store The Pebbling Status. Other Data Structures Will Be Needed To Support The Graph Search Technique That You Choose
9.Your Solution Must Take O⎛⎜N2⎞⎟ Time, So No Adjacency Matrices.
10.Inputs A.Dat And Lab5fall19.C.Dat Are Minimally Rigid. Inputs Lab5fall19.B.Dat And
Lab5fall19.D.Dat Are Not.
Related Questions
. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C
DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma
. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:
1
Project 1
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of
. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:
1
Project 2
Introduction - the SeaPort Project series
For this set of projects for the course, we wish to simulate some of the aspects of a number of