Professional Documents
Culture Documents
Discrete Math 07
Discrete Math 07
Graph
Today’s Tree
Menu:
Their implementation in
IT/CS
TL;DR: How we represent
relationship among discrete
objects
What the We represent them as nodes and
junk is edges indicating relationship
among nodes
Graph?
We can also put some weight on
edges (later!)
A tiny bit of history
Un-directed graph
Types of Directed graph
Graphs
Multigraph
Pseudograph
Electrical and electronics circuit
Flowchart
Adjacent
Incident
Isolated Vertex
Null/Empty Graph
Degree
Path
Terminologies: Circuit/Cycle
Connected
Subgraph
Spanning Subgraph
Cut-Set
Weighted Graph
Complete Graphs
Some
special Circular Graphs
simple Regular Graphs
graphs
Bipartite Graphs
Using adjacency Matrix
How do we
represent Incidence Matrix
graph in
Adjacency List
our field?
• Same deal with DS&A
TL;DR: is a graph that have
same representation
Isomorphic • Shapes may differ, but adjacency
Graph is the same
Path and You can make Euler Circuit if and only if all vertices has
even degree
Tree
tree must be minimum, but the tree must be
formed
Tree
• Officially, this is directed, but normally
is omitted
Path
Some Sibling
Subtree
terminologies Degree
Internal Nodes
Level
Height or Depth
Is a tree that each
internal node has at
most M children
M-ary tree
Full M-ary tree:
Where all nodes are
full
Is crucial for our
field in IT
Binary Tree
Recall M-ary tree,
in binary tree, M =
2
Language parsing tree
• Both computer language (which you don’t get
Application
now) and Human Language
Expression Tree
of Tree Decision tree
structure: Huffman Coding (in data
compression)
Binary Search Tree
Tree Traversal Strategies
• Pre-order: root first
• In-order: First child first, then root, then all other children
• Post-order: Children first, then root
• Often made easy with binary tree