An insect graph is an unweighted, directed graph resembling an insect in that one vertex - the
Question:
An "insect graph" is an unweighted, directed graph resembling an insect in that one vertex - the "body" - appears to have two "antennae" and six "legs". (In the diagram below, there is no particular significance to the vertex labels, other than to highlight that said antennae and legs are edges whose endpoints are vertices.)
We are interested in two related problems:
IS-INSECT-GRAPH-PROBLEM (IIGP): Is an arbitrary graph G an "insect graph", i.e. does it have the configuration described above?
CONTAINS-INSECT-GRAPH-PROBLEM (CIGP): Does an arbitrary graph G contain an "insect graph", i.e. does it have a subgraph (subsets of vertices and edges) with the configuration above?
Imagine you are giving a lecture on this "Insect Graph Problem": Discuss it the way we might in class, including:
present pseudocode for several algorithmic approaches to these problems, starting with Brute Force but also consider techniques such as Parallelization, Randomization, Greedy Strategy, Pre-processing, etc. that offer improvement over brute force analyze and justify the time complexity of your algorithms for Adjacency Table and Adjacency Matrix graph representations conclude which approaches are best suited, and what "it depends" on.
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss