Basic Terminology Func.Ons

Basic Terminology Func.Ons

CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs f A a 1 B Major Themes a c b 2 c 3 f d 4 d e 5 b • Funcons • g Func6ons and Graphs Graphs e – f : A→B – verces – domain/co-domain – edges CSC 1300 – Discrete Structures – range – path Villanova University – one-to-one – cycle – onto – Handshaking theorem – bijecon – Isomorphism Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Func6ons: Basic terminology Func6ons: How many? A funcon f from A to B assigns exactly one element of B to each element of A. A a 1 f B A a 1 f B f : A→ B b 2 f : A→ B b 2 c 3 c 3 d 4 d 4 domain co-domain e 5 domain co-domain e 5 or or target space target space • We write f(x) = y if the func6on f assigns y to x Suppose |A| = m, |B| = q. • The range of f is the set of all images of elements of A. m • How many func6ons are there from A to B? q NB: Range can be smaller than co-domain! • …one-to-one func6ons? q(q-1)(q-2)…(q-(m-1)) • (… onto? …. this ques6on is much harder, see #24 in Chapter) 6 Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Dr Papalaskari 1 CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs One-to-One Func6ons Onto Func6ons • A funcon ƒ : X→Y is one-to-one (or injecve) iff for A funcon ƒ : X→Y is onto (or surjecve) if for each y∈Y there is at most one x∈X with ƒ(x) = y each y∈Y there exists an x∈X with ƒ(x) = y • Examples: (co-domain = range) {(1,5), (2,3), (4,5) } ƒ(x) = x2 for x ∈ Z ƒ(x) = x2 for x ∈ {1,0,-1} ƒ(x) = x2 for x ∈ {1,0,2} {(1,2), (2,4), (3,6), (4,6) } and y ∈ {1,0,2} and y ∈ {1,0,4} one-to-one / injective Not one-to-one 1 2 1 1 1 1 2 4 1 5 1 1 0 0 0 0 3 6 2 3 0 0 -1 2 2 4 4 4 6 -1 Onto (but not Not onto Onto and one-to-one) one-to-one Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari (Bijection) Bijecons Graphs • A funcon ƒ from X to Y is a bijecon (or a • Graphs are discrete structures consis6ng of one-to-one correspondence) if it is both ver6ces and edges that connect these injec6ve and surjec6ve. verces. Ques4ons • Graphs can be used to model: nisomorphism ƒ(x) = x2 for x ∈ {1,0,2} nshortest paths and y ∈ {1,0,4} – computer systems/networks a c Example. Let f(x) = x+1. Is f a bijec6on? – mathemacal relaons ncycles/paths 1 1 nplanarity • if the domain and codomain are N? - no f 0 0 – logic circuit layout ncoloring d • if the domain and codomain are Z? -yes 2 4 – jobs/processes b • if the domain and codomain are R? -yes Onto and e one-to-one Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari (Bijection) Dr Papalaskari 2 CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs Graphs: Basic Terminology Directed Graphs • By defini6on, the edges of a directed graph • A graph is defined as G = (V, E) with the set of are ordered pairs. ver6ces V and a set of edges E • In a directed graph, if we have edge e = (u,v), • Two ver6ces u and v in an undirected graph G then are adjacent (or neighbors) if {u, v} is an edge of G. – u is said to be adjacent to v, the terminal vertex – v is said to be adjacent from u, the ini:al vertex – The edge e is said to connect (or to be incident e = (a,b) with) u and v. b c 1 e2 = (b,a) v2 e v3 2 e = (b,c) 3 G = ({v , v ,v }, {e , e }) a d e = (b,d) 1 2, 3 1 2 e1 4 eg: edge e2 connects v2 and v3 G e5 = (d,d) v1 Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Types of Graphs Degree of a vertex • The degree of a vertex v is the number of Multiple Type Edges Edges? Loops? edges incident on v. Simple graph Undirected No No – Denoted deg(v) Multigraph Undirected Yes No – A loop on v contributes 2 to the deg(v) Pseudograph Undirected Yes Yes Directed graph Directed No Yes Directed multigraph Directed Yes Yes • Example: deg(a) = 3 b c e deg(b) = 1 deg(c) = 5 deg(e) = 0 a d deg(d) = 1 Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Dr Papalaskari 3 CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs Handshaking Lemma Path In an undirected graph, the sum of the degrees • A path begins at vertex v0, follows an edge e1 of the ver6ces is twice the number of edges. to v1, follows another edge to v2 … Therefore, the sum of the degrees of all the – A path is represented without edges (especially verces is even. when there are no parallel edges) • (v0, v1, v2, … vn) – Said to be of length n Σ deg(v) = 2|E|. • A path on a vertex itself is of length 0 v∈V • A simple path from v0 to vn is a path with no • Corollary: An undirected graph has an even repeated edges. number of verces of odd degree. Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Cycle Connected Graph • A cycle (or circuit) is a path of nonzero length • A graph G is connected if given any ver6ces v1 from v to v. and v2 in G, there is a path from v1 to v2. Some cycles: b c e (b,c,d,e,a,b) (a,b,a,e,d,c,a) Connected (b,a,c,d,e,a,b) b c Not Connected a d (a,d,c,a,e,d,a) e f (c,d,e,a,b,c) b c f • A simple circuit is a circuit from v to v with no repeated edges a d a d connected components Villanova CSC 1300 - Dr Papalaskari Tree: a connected graph with no cyclesVillanova CSC 1300 - Dr Papalaskari Dr Papalaskari 4 CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs Bipar6te Graph Special Graphs • A simple graph is called biparte if its vertex • Complete Graph - Kn – Simple graph that contains exactly 1 edge between each pair set V can be par66oned into 2 disjoint sets V1 of n dis6nct ver6ces. and V such that every edge in the graph 2 • Complete Bipar6te Graph – Kn,m connects a vertex in V1 to a vertex in V2. – Simple graph that contains exactly 1 edge between each pair of n dis6nct ver6ces to m dis6nct ver6ces. b c b c V V • Cycles – Cn 1 – For n≥3, consists of n ver6ces and edges {v ,v }, {v ,v } … a d a d 1 2 2 3 e {vn-1,vn} 2 Not Bipar4te • Wheels – W Bipar4te e n V = {b,a,e} – Cycle Cn with an addi6onal vertex added and an 1 edge from the new vertex to each of the n ver6ces V2 = {c,d} Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Representaon of Graphs Isomorphism… V E {{a, b, c, d, e}, {{a,b}, {b,b}, {c,d}, {a,c}, {e,d}, {e,d}, {a,e}} • It means two graphs are essen6ally the same b (maybe drawn differently and re-labeled) e1 e2 a e4 c – Same number of ver6ces necessary but NOT sufficient e e7 3 e condions e 5 d mulset representaon (allows repe66on) – Same number of edges e6 1 – Same degree sequence a Adjacency list Adjacency matrix b G2 3 a: b, e a b c d e G1 2 a 0 1 1 0 1 b: a, b d b 1 1 0 0 0 5 c: a, d c 1 0 0 1 0 c 4 e d: c, e, e d 0 0 1 0 2 f e: a, d, d e 1 0 0 2 0 6 Some6mes it is hard to tell… Villanova CSC 1300 - Dr Papalaskari 3.8 Problem#3: are these essen6ally the same graph? Villanova CSC 1300 - Dr Papalaskari Dr Papalaskari 5 CSC 1300 – Discrete Structures Chapter 3: Func6ons and Graphs Isomorphism Isomorphism • Graphs are isomorphic if they have the same Isomorphic graphs will have the same adjacency matrix structure under some reordering of the ver&ces – 1-to-1 mapping of ver6ces that preserves edges abcdef è bacdfe a c b c 0 1 1 0 1 0 a c f a e f 1 0 0 1 0 0 1 0 0 1 0 0 e e f e 0 1 1 0 0 1 d d 1 0 0 0 0 1 f b b a d 0 0 0 1 1 0 b d c Villanova CSC 1300 - Dr Papalaskari Villanova CSC 1300 - Dr Papalaskari Special Graphs More Graph Terminology • Connected, simple graph Let G = (V, E) – The complement G = (V, E’) – Cycle Cn • where E’= {{u,v} | u ∈ V and v ∈ V and {u,v} ∉ E} – Wheels Wn – ⊆ – Complete graph K A graph G’=(v’,E’) is a subgraph of G iff V’ V n and E’⊆ E – The Complement Graph G – A connected component of a graph is a – A Complete Bipar6te Kn,m subgraph that is connected.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us