How many undirected graphs (not necessarily connected) can be constructed out of a given set V= {V 1, V 2,…V n} of n vertices ?
Group of answer choices
2^(n(n-1)/2)
2^n
n(n-l)/2
n!
Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph?
Adding a vertex in adjacency list representation is easier than adjacency matrix representation.
In adjacency list representation, space is saved for sparse graphs.
DFS and BSF can be done in O(V + E) time for adjacency list representation. These operations take O(V^2) time in adjacency matrix representation. Here is V and E are number of vertices and edges respectively.
All of the above
Given the starting vertex A, what is the visit order of the graph shown in Fig. 1 under
the DFS traversal
ABDCFE
ACBDFE
ABCDFE
ADBCEF
Assume you have the adjacency matrix representing a graph. 1 represents a connection while -1 represents a lack of one:
[-1, 1, - 1]
[-1, -1, 1]
[1, -1, -1]
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps
- True or false helparrow_forwardPlease give detailed steps, thank you!arrow_forwardDiscrete mathematics. Let G = (V, E) be a simple graph4 with n = |V| vertices, and let A be its adjacency matrix of dimension n × n. We want to count the L-cycles : such a cycle, denoted by C = u0u1 · · · uL with uL = u0 contains L distinct vertices u0, . . . , uL-1 et L edges E(C) = {uiui+1 | 0 ≤ i ≤ L − 1} ⊆ E. Two cycles are distinct if the edge sets are different : C = C' if and only if E(C) = E(C'). We define the matrices D, T, Q, the powers of A by matrix multiplication : D = A · A = A2, T = A · D = A3, Q = A · T = A4. Consider the values on the diagonals. Prove that the number of 3-cycles N3 in the whole graph is N3 = 1/6 ∑ u∈V Tu,uarrow_forward
- Consider an undirected graph on 8 vertices, with 12 edges given as shown below: Q2.1 Give the result of running Kruskal's algorithm on this edge sequence (specify the order in which the edges are selected). Q2.2 For the same graph, exhibit a cut that certifies that the edge ry is in the minimum spanning tree. Your answer should be in the form E(S, V/S) for some vertex set S. Specifically, you should find S.arrow_forwardGiven a graph G = (V;E) an almost independent set I V is a generalization of an independent set whereeach vertex u 2 I is connected to at most one other vertex in I but no more. In other words for all u; v 2 Iif (u; v) 2 E then (u; z) =2 E for all z 2 I (equvalently (v; z) =2 E). Note that every independent set is alsoalmost independent. Prove that the problem of nding whether there exists an almost independent set ofsize k for some k, is NP-complete.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education