ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalGE-167Trees Graph Theory
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    GE-167

    Discrete Structures

    Progress0 / 67 done
    Topics67
    1Propositional and Predicate Logic
    2Logical Operators3Translations Between Symbolic Expressions and Formal English Expression4Logical Equivalences
    5Quantifiers6Nested Quantification7Equivalences in Predicate Logic8Translations Between Symbolic Forms and Formal English
    9Proof Methods and Strategies10Direct Proof11Proof by Contraposition12Proof by Induction13Proof by Implication14Existence Proof15Uniqueness Proofs16Trivial Proofs17Vacuous Proofs
    18Notations and Set Operations19Venn Diagrams20Countable and Uncountable Sets
    21Equivalence Relations and Partitions22Partial Orderings23Recurrence Relations51Reflexive, Symmetric, Transitive, and Antisymmetric52Equivalence Relations and Equivalence Classes53Partial Orders
    24Injective, Surjective, Bijective25Special Types of Functions26Function Composition27Inverse Functions28Recursive Functions29Compositions
    30Sequences and Series
    31Inclusion and Exclusion Principle32Pigeonhole Principle33Permutations and Combinations46Product Rule and Sum Rule47Principle of Inclusion-Exclusion48Binomial Coefficients49Pascal's Identity and Pascal’s Triangle50Binomial Theorem
    34Division Theorem35Modular Arithmetic36LCM and GCD37Euclidean and Extended Euclidean Method38Finding Solutions to Congruence
    39Fundamental Theorem of Arithmetic40Characterizations of Primes41Mersenne Primes
    42Weak Induction43Strong Induction
    44Formulation of Recurrences45Closed Formulas
    54Terminologies55Elements of Graph Theory56Planar Graphs57Graph Coloring58Euler Graph59Hamiltonian Path60Rooted Trees61Graph Traversals62Handshaking Lemma and Corollary63Special Families of Graphs64Graph Isomorphism65Planarity in Graphs66Eulerian and Hamiltonian Graphs67Trees in Graph Theory
    7 min read
    Topic 67 of 67
    Topic Study Note Illustration
    67

    Trees in Graph Theory

    A tree is a special type of graph that plays a fundamental role in many areas of graph theory and computer science. It is a connected, acyclic...

    Trees in Graph Theory

    A tree is a special type of graph that plays a fundamental role in many areas of graph theory and computer science. It is a connected, acyclic graph. In simpler terms, a tree is a graph that:

    1. Is connected, meaning there is a path between every pair of vertices.
    2. Does not contain any cycles (i.e., no closed loops or circuits).

    Trees are widely used in various fields such as computer science (e.g., file systems, binary trees, etc.), network design, and data structures.


    Formal Definition of a Tree

    A tree is an undirected graph T=(V,E)T = (V, E)T=(V,E) that satisfies the following properties:

    • The graph is connected, meaning for any two vertices uuu and vvv, there exists a path between them.
    • The graph is acyclic, meaning it contains no cycles (closed loops).

    In addition, a tree with nnn vertices always has n−1n - 1n−1 edges.


    Properties of Trees

    1. Number of Edges:

      • A tree with nnn vertices always has exactly n−1n - 1n−1 edges.
      • This property is crucial because it differentiates trees from general graphs. Any connected graph with nnn vertices and fewer than n−1n - 1n−1 edges is not connected, and any connected graph with more than n−1n - 1n−1 edges must contain a cycle.
    2. Uniqueness of Paths:

      • In a tree, there is exactly one path between any two vertices. This is because a cycle-free structure ensures that there is no ambiguity about the route between vertices.
      • If you have more than one path between two vertices, the graph is not a tree.
    3. Acyclic:

      • By definition, trees do not contain cycles. This acyclic nature makes trees particularly useful in hierarchical structures like family trees, organizational charts, and file systems.
    4. Leaf and Internal Vertices:

      • Leaf: A leaf is a vertex in a tree that has only one edge connected to it (degree 1).
      • Internal Vertex: An internal vertex has at least two edges connected to it.
      • The number of leaves in a tree is always at least 2, except for the trivial case of a single vertex.
    5. Subtrees:

      • Any subtree of a tree is itself a tree. A subtree is a graph formed by selecting a vertex of the tree and all of its descendants (if we consider a rooted tree).
    6. Spanning Tree:

      • A spanning tree of a graph is a subgraph that is a tree and includes all the vertices of the original graph. Every connected graph has at least one spanning tree.

    Types of Trees

    1. Rooted Tree:

      • A rooted tree is a tree in which one vertex is designated as the root. All edges are directed away from the root, creating a parent-child relationship among the vertices.
      • In a rooted tree, there is a concept of depth (the level of a node in relation to the root) and height (the length of the longest path from the root to any leaf).
    2. Binary Tree:

      • A binary tree is a rooted tree in which each vertex has at most two children. Binary trees are widely used in computer science for efficient searching and sorting (e.g., binary search trees).
      • Types of binary trees:
        • Full Binary Tree: Every node has either 0 or 2 children.
        • Perfect Binary Tree: All internal nodes have exactly two children, and all leaves are at the same level.
        • Complete Binary Tree: All levels of the tree are completely filled except possibly for the last level, which is filled from left to right.
        • Balanced Binary Tree: The difference in height between the left and right subtrees of every node is at most 1.
    3. Trie (Prefix Tree):

      • A Trie is a special type of tree used to store a dynamic set of strings, where nodes represent prefixes of strings. It is commonly used in searching and autocomplete applications.
    4. AVL Tree (Self-balancing Binary Search Tree):

      • An AVL tree is a binary search tree in which the height of the left and right subtrees of any node differs by at most one. This ensures logarithmic time complexity for searching, insertion, and deletion.
    5. B-tree:

      • A B-tree is a self-balancing search tree used in databases and file systems. It generalizes the concept of a binary search tree to allow nodes to have more than two children, making it suitable for systems that read and write large blocks of data.

    Applications of Trees

    1. Hierarchical Data Representation:

      • Trees are ideal for representing hierarchical structures such as:
        • File systems: A directory structure where directories and files are organized in a tree-like manner.
        • Organizational charts: Employees and their hierarchical reporting relationships.
        • Family trees: Relationships between family members across generations.
    2. Search and Sorting:

      • Trees, particularly binary search trees, are used to perform efficient searches and sorts. Operations like insertion, deletion, and searching can be done in logarithmic time in balanced binary search trees (e.g., AVL trees, red-black trees).
    3. Decision Making:

      • Decision Trees are used in decision-making algorithms (like in machine learning) to model decisions and their possible consequences.
    4. Network Routing:

      • Trees are used in computer networks to represent routing paths. For example, spanning trees are used to determine the optimal routing paths in a network.
    5. Game Trees:

      • In artificial intelligence, trees are used to represent all possible moves in a game. Each node in the tree represents a possible game state, and the edges represent the moves that lead to other states.

    Algorithms on Trees

    1. Depth-First Search (DFS):

      • DFS is a graph traversal algorithm that explores as far as possible along each branch before backtracking. In the case of trees, it starts at the root and explores as deep as possible before visiting other branches.
    2. Breadth-First Search (BFS):

      • BFS is another graph traversal technique, where the algorithm explores all nodes at the present depth level before moving on to nodes at the next depth level. In a tree, this is often used to explore nodes level by level.
    3. Minimum Spanning Tree (MST):

      • A minimum spanning tree is a subset of the edges of a connected, weighted graph that connects all the vertices together, without any cycles, and with the minimum possible total edge weight. Algorithms like Kruskal's algorithm and Prim's algorithm are used to find MSTs.
    4. Tree Dynamic Programming:

      • Many algorithms on trees, such as finding the longest path or the diameter of the tree, can be solved using dynamic programming. The idea is to solve smaller subproblems and use their solutions to build up the solution for the entire tree.

    Conclusion

    Trees are one of the most fundamental structures in graph theory, and they have a wide range of applications in computer science, data structures, network design, and more. Their properties of being acyclic and connected, and their versatility in representing hierarchical structures, make them indispensable tools for problem-solving in various domains. Whether it's in search algorithms, databases, decision making, or organizing data, trees provide efficient and intuitive ways to represent relationships and solve computational problems.

    ← Previous topic 66
    Eulerian and Hamiltonian Graphs

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    7mremaining
    1.2kwords
    Intermediatelevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Discrete Structures