달력

2

« 2025/2 »

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
2015. 12. 10. 01:21

Tree 전자공학이론/이산수학2015. 12. 10. 01:21

Tree

A (free) tree T is a simple graph such that for every pair of vertices v and w there is a unique path from v to w.

A rooted tree is a tree where one of its vertices is designated the root.


Isomorphic rooted trees

Let T1 be a rooted tree with root r1 and let T2 be a rooted tree with root r2. 

The rooted trees T1 and T2 are isomorphic if there is a one-to-one, onto function f from the vertex set of T1 to the vertex set of T2 satisfying the following:

(a) (vi, vj) ∈ T1 if and only if (f(vi), f(vj)) ∈ T2.

(b) f(r1) = r2.


Level & height

The level of a vertex v is the length of the simple path from the root to v.

The height of a rooted tree is the maximum level number of its vertices.


Terminology

Let T be a tree with root v0. Suppose that x, y and z are vertices in T and that (v0, v1, ..., vn) is a simple path in T, then

(a) the parent of v(n) is v(n-1).

(c) a child of v(n-1) is vn.

(b) ancestors of v(n) are v0, ..., v(n-1).

(d) descendants of v(n-2) are v(n-1), vn.

(e) x and y are siblings if x and y are children of z.

(f) a terminal vertex (or a leaf) is a vertex that has no children.

(g) an internal (or branch) vertex is a vertex that has at least one child. 

(h) a subtree T' of a tree T is a graph where

V(T') = { v0 and the descendants of v0 }

E(T') = { e | e is an edge on a simple path from v0 to some vertex in V(T') }


Theorem

Let T be a graph with n vertices. The following are equivalent.

(a) T is a tree.

(b) T is connected and acyclic.

(c) T is connected and has n-1 edges. //vertex들을 연결할 수 있는 최소한의 구조

(d) T is acyclic and has n-1 edges.











'전자공학이론 > 이산수학' 카테고리의 다른 글

Binary Tree  (0) 2015.12.10
Spanning Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
:
Posted by youjin.A

Isomorphic Graphs

Graphs G1 and G2 are isomorphic if there is a one-to-one, onto function f from the vertices of G1 to vertices of G2 and a one-to-one, onto function g from the edges of G1 to the edges of G2, so that e=(v,w) in G1 if and only if g(e)=(f(v), f(w)) in G2.

Theorem

Graphs G1 and G2 are isomorphic if and only if for some ordering of their vertices, their adjacency matrices are equal.




Homeomorphic graphs

Graphs G1 and G2 are homeomorphic if G1 and G2 can be reduced to isomorphic graphs by performing a sequence of series reductions




Planar graph

A graph is planar if it can be drawn in the plane without its edges crossing,

Theorem 1

if G is a connected planar graph, then v-e+f=2 and 2e>=sf.

v=number of vertices

e=number of edges

f=number of faces, including the exterior face

s=minimum number of edges for making a face

Theorem 2

G is a planar graph if and only if G does not contain a subgraph homeomorphic to either K5 or K3,3.

following graph is not planar:








'전자공학이론 > 이산수학' 카테고리의 다른 글

Spanning Tree  (0) 2015.12.10
Tree  (0) 2015.12.10
A shortest-path algoritnm  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
Graph  (0) 2015.12.09
:
Posted by youjin.A
2015. 12. 9. 20:58

A shortest-path algoritnm 전자공학이론/이산수학2015. 12. 9. 20:58

Dijkstra's Algorithm

Input:    A connected, weighted graph in which all weights are positive;

vertices a and z

Output:    L(z), the length of a shortest path from a to z

1
2
3
4
5
6
7
8
9
10
11
12
13
dijkstra(w, a, z, L){
    L(a) = 0
    for all vertices x≠a
        L(x) = ∞
    T = set of all vertices
 
    while(z∈T){
        choose v∈T with minimum L(v)
        T = T-{v}
        for each x∈T adjacent to v
            L(x) = min{L(x), L(v) + w(v, x)}
    }
}
cs

2~5행:     vertex a의 길이를 0으로 설정하고 a를 제외한 나머지 vertex의 L은 ∞로 설정한다. T는 그래프              의 모든 vertex의 집합이다.

8~11행:     T안에있는 vertex 중에서 L이 최소인 vertex v를 선택하고 그 v를 집합 T에서 삭제한다. T에                 포함되어 있는 것중 v와 연결되어 있는 vertex에 대하여, L를 업데이트한다. 이것은 z가 T에                 포함되지 않을 때가지 반복한다.

 ***최소 path 찾기*** vertex에 label을 붙일 때, 최소 길이 뿐만아니라 이어지는 바로 전 vertex의 이름을 같이 적으면 두 vertex 사이의 최소 path를 찾을 수 있다.






'전자공학이론 > 이산수학' 카테고리의 다른 글

Tree  (0) 2015.12.10
Isomorphic Graphs / Homeomorphic graphs/ Planar graph  (0) 2015.12.09
Euler cycle & Hamiltonian cycle  (0) 2015.12.09
Graph  (0) 2015.12.09
6. Proofs  (0) 2015.10.17
:
Posted by youjin.A