170 likes | 264 Views
CSCI 115. Chapter 8 Topics in Graph Theory. CSCI 115. §8 .1 Graphs. §8 .1 – Graphs. Graph A graph G consists of a finite set of vertices V, a finite set of edges E, and a function γ that assigns a subset of vertices {v, w} to each edge (v may equal w)
E N D
CSCI 115 Chapter 8 Topics in Graph Theory
CSCI 115 §8.1 Graphs
§8.1 – Graphs • Graph • A graph G consists of a finite set of vertices V, a finite set of edges E, and a function γ that assigns a subset of vertices {v, w} to each edge (v may equal w) • If e is an edge, and γ(e) = {v, w} we say e is the edge between v & w, and that v & w are the endpoints of e
§8.1 – Graphs • Terminology • Degree of a vertex • Number of edges having that vertex as an endpoint • Loop • Edge from a vertex to itself • Contributes 2 to the degree of a vertex • Isolated vertex • Vertex with degree 0 • Adjacent vertices • Vertices that share an edge
§8.1 – Graphs • Path • A path in a graph G consists of a pair of sequences (V, E), V: v1, v2, …, vk and E: e1, e2, …, ek–1 s.t.: • γ(ei) = {vi, vi+1} i • ei ej i, j
§8.1 – Graphs • More terminology • Circuit • Path that begins and ends at the same vertex • Simple path • No vertex appears more than once (except possibly the first and last) • Simple circuit • Simple path where first and last vertices are equal
§8.1 – Graphs • Special types of graphs • Connected graph • path from every vertex to every other (different) vertex • Disconnected graph • There are at least 2 vertices which do not have a path between them • components • Regular Graph • All vertices have the same degree
§8.1 – Graphs • Special families of graphs (n Z+) • Un: The discrete graph on n vertices • The graph with n vertices and no edges • Kn: The complete graph on n vertices • The graph with n vertices, and an edge between every pair of vertices • Ln: The linear graph on n vertices • The graph with n vertices and edges {vi, vi+1} i {1, 2, …, n – 1}
§8.1 – Graphs • Subgraphs • If G = (V, E, γ) and E1 E, V1 V s.t. V1 contains (at least) all of the end points of edges in E1, then H = (V1, E1, γ) is a subgraph of G • If G = (V, E, γ) and e E, then Ge is the subgraph found by deleting e from G and keeping all vertices
§8.1 – Graphs • Quotient graphs • If G = (V, E, γ) and R is an equivalence relation on V, then GR is the quotient graph found by merging all vertices within the same equivalence classes.
CSCI 115 Chapter 10 Languages and Finite State Machines
CSCI 115 §10.3 Finite State Machines
§10.3 – Finite State Machines • Machine • A machine is a system that accepts input, produces output, and has memory to keep track of previous inputs (which many be manipulated) • State • A state is the complete internal condition of the machine (i.e. the memory) • Affects reaction to subsequent I/O
§10.3 – Finite State Machines • Finite State Machine (FSM) • A machine that has a finite number of states • Example: computer
§10.3 – Finite State Machines • Assume we have the following: • S = {s0, s1, …, sn} is a set with n elements • A finite set I • xI, fx:SS. • Let F = {fx | x I} • Then (S, I, F) is a finite state machine
§10.3 – Finite State Machines • Given (S, I, F) is a FSM, we have the following: • S is the state set • si is a state si S • I is the input set • x I, fx describes the effect the input x has on the state of the machine • State transition function • If the machine is in state si and the input x occurs, the next state is fx(si) • State transition table – matrix showing the effects of the various inputs on the various states
§10.3 – Finite State Machines • Relation arising from finite state machines • If M is the FSM (S, I, F) then define RM as follows: • RM is a relation on S • si RMsjiff x I s.t. fx(si) = sj • Edges in the digraph of RM are labeled with all inputs that create that state transition • We will not be covering Moore Machines, Machine Congruences, or Quotient Machines