8 Lecture

CS502

Midterm & Final Term Short Notes

Graphs

Graphs are mathematical structures used to model relationships between objects or entities. They consist of a set of vertices or nodes, connected by edges or arcs. Graphs can be directed or undirected, weighted or unweighted, and may contain loo


Important Mcq's
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is a graph? A. A visual representation of data B. A mathematical structure used to model relationships C. A type of tree D. A type of function Answer: B What is a directed graph? A. A graph with loops B. A graph with weighted edges C. A graph with arrows on the edges D. A graph with multiple edges Answer: C What is an undirected graph? A. A graph with loops B. A graph with weighted edges C. A graph with arrows on the edges D. A graph with multiple edges Answer: D What is a weighted graph? A. A graph with loops B. A graph with arrows on the edges C. A graph with multiple edges D. A graph with values assigned to its edges Answer: D What is a cycle in a graph? A. A path from one vertex to another B. A connected component of a graph C. A sequence of vertices and edges that starts and ends at the same vertex D. A set of vertices that are not connected by any edge Answer: C What is a connected graph? A. A graph with no cycles B. A graph with all vertices connected by at least one edge C. A graph with multiple edges between vertices D. A graph with no loops Answer: B What is a tree? A. A type of graph with no cycles B. A type of graph with multiple edges C. A type of graph with loops D. A type of graph with weighted edges Answer: A What is a bipartite graph? A. A graph with no cycles B. A graph with weighted edges C. A graph with two sets of vertices such that each edge connects a vertex from one set to a vertex in the other set D. A graph with multiple edges between vertices Answer: C What is a spanning tree? A. A tree that includes all vertices of a graph B. A tree with no cycles C. A tree with multiple edges between vertices D. A tree with weighted edges Answer: A What is the minimum spanning tree of a graph? A. The smallest tree that includes all vertices of the graph B. The tree with the minimum weight among all possible spanning trees of the graph C. The tree with the maximum weight among all possible spanning trees of the graph D. A tree that includes only a subset of the vertices of the graph Answer: B



Subjective Short Notes
Midterm & Finalterm Prepration
Past papers included

Download PDF
  1. What is a vertex in a graph? A vertex, also known as a node, is a fundamental unit of a graph that represents an entity or object. What is an edge in a graph? An edge, also known as an arc, is a connection between two vertices that represents a relationship between them. What is a directed graph? A directed graph is a graph where the edges have a direction or orientation. What is an undirected graph? An undirected graph is a graph where the edges have no direction or orientation. What is a weighted graph? A weighted graph is a graph where the edges have a numerical value assigned to them. What is a connected graph? A connected graph is a graph where there is a path between any two vertices in the graph. What is a cycle in a graph? A cycle is a sequence of vertices and edges that starts and ends at the same vertex. What is a tree? A tree is a connected acyclic graph, which means that there are no cycles in the graph. What is a bipartite graph? A bipartite graph is a graph where the vertices can be divided into two sets, such that each edge connects a vertex from one set to a vertex in the other set. What is a path in a graph? A path is a sequence of vertices and edges that connects two vertices in a graph.

Graphs are mathematical structures used to represent relationships between objects or entities. They are composed of a set of vertices or nodes, and a set of edges that connect them. Edges can be directed, indicating a one-way relationship between vertices, or undirected, indicating a two-way relationship. Graphs can be used to model a variety of systems, from social networks to transportation networks. They have many applications in computer science, including computer networks, optimization, and algorithms. One important concept in graphs is the degree of a vertex, which is the number of edges connected to it. In a directed graph, vertices have an in-degree and an out-degree, which represent the number of incoming and outgoing edges, respectively. A path in a graph is a sequence of vertices and edges that connect two vertices. A cycle is a path that starts and ends at the same vertex. A connected graph is one where there is a path between any two vertices, while a disconnected graph has at least two vertices that are not connected by any path. A tree is a connected, acyclic graph, where acyclic means that there are no cycles. A spanning tree is a subgraph that includes all vertices of the original graph, while a minimum spanning tree is a spanning tree with the smallest possible weight. Graph algorithms are used to solve problems related to graphs. One common algorithm is Dijkstra's algorithm, which finds the shortest path between two vertices in a weighted graph. Another algorithm is Kruskal's algorithm, which finds the minimum spanning tree of a weighted graph. In summary, graphs are powerful mathematical structures that allow us to represent and analyze relationships between objects or entities. They have many applications in computer science, and graph algorithms are used to solve a variety of problems related to graphs.