Alterna · учебный материал
Graphic models.
Graphic information models: graphs, trees, routes, cycles, interactive construction of related matrix.
Что в этом материале
- Associated table
- Königsberg Bridges
- Basic concepts
- Graphic tasking methods
- Types of graphs
- Routes and routes
- Linkage of graphs
- Top degree. Regular graphs
- Eilers and Hamilton Cycles
- Associated matrix: Interactor
- Mini-test: 5 questions
Содержание и основные понятия
By table of contents
Alterna · Chapter 23 · page 23.3
Graphic models.
Points and lines between them are a universal language for charts, maps, networks, algorithms.
Count
The graphs describe road maps, computer networks, social connections, algorithm block diagrams, and all started with the Königsberg Bridge problem in 1736.
GEF
PIF
OGE No. 4.9
EGE No. 1
01
Associated table
Number presentation of graph
How to write the graph by number
Associated table
is a two-dimensional table with the size , , V in a cell.
A[i][j]
shall be:
0
- no ribs between the tops
1
- there's a rib (or the number of ribs for the cartoon)
Неориентированный граф
— матрица симметрична: A[i][j] = A[j][i]
Ориентированный граф
— матрица несимметрична: A[i][j] ≠ A[j][i]
Weight matrix
- same but in the cell, the weight of the rib (number or ) is the same.
Example: unoriented graph (4 vertebrates)
V = {A, B, V, G}, E = {a, B}, {B,B},{B,G}, four ribs.
A
B
B
G
A
B
B
G
Degree
A
0
1
1
0
2
B
1
0
0
1
2
B
1
0
0
1
2
G
0
1
1
0
2
The sum of the elements = 8 = 2 x 4 ribs. The matrix is symmetrical relative to the diagonal.
02
Königsberg Bridges
Where the Count theory comes from
1736 - Leonard Eyler
In Königsberg (now Kaliningrad), the Pregel River divided the land into four parts, connected by seven bridges.
Is it possible to cross all bridges exactly once and return to the starting point?
Eyler abstracted the problem: the steel banks
Tops
♪ Bridges ♪
ribs
He proved that such a bypass was impossible — the two vertices had an odd degree (B=5, G=3), and the cycle required evens for everyone.
Эйлеров цикл:
все вершины — чётная степень
Эйлерова цепь:
ровно 2 вершины — нечётная степень
🌇
The Königsberg Bridge Challenge
A
Altstadt
B
Kniphof
B
Forstadt
G
Lomse
a
b
c
d
e
f
g
Associated table:
A
B
B
G
deg
A
0
2
0
0
2
B
2
0
2
1
5
B
0
2
0
2
4
G
0
1
2
0
3
♪ B (5) and G(3) are odd ♪ no cellar cycle
7 bridges: a,b - Altstadt - Knaiphof; c,d - Forstadt ~ Knayphoff; e - Kniphof - Lomze; f,g - Forstadt - Lohmze
Animation goes through bridges, two peaks with odd degrees make complete bypass impossible.
03
Basic concepts
Tops, ribs, degrees, loops, relatedness, incidence
GEF
Definitions
Count G=(V, E)
- multiple v-tops and many E ribs.
Top
(neck) is the object of the graph.
Rib
(arc) is a connection between the two vertices.
End tips
- the vertebrates that determine the rib.
Degree
Deg(v) is the number of ribs that have occurred at the top.
The Wing
- rib, beginning and end in one top.
Related vertices
- the tips of the same rib.
Related ribs
- having a common end point.
Incident
- rib e incidentally v
i
and v
j
.
Isolated top
- Level 0.
Parallel ribs
- with the same end-points.
Sub-graph
is part of the graph, which is the graph itself.
Lemma on handshakes.
The sum of the degrees of all the vertebrates is equal to twice the number of ribs:
Σ deg(v) = 2 · E
Effect: number of vertices of odd degree always
Even.
.
04
Graphic tasking methods
Algebraic, geometric, related matrix, incident matrix
1. Algebraic
Two sets: V = {a, b, c, d} and E = {{a,b}, {b,c},{a ,c , {c,d}}.
a
b
d
c
2. Geometrical
Figure: dots are vertices, lines are ribs.
a
b
d
c
3. Associated matrix
A[i][j] = number of ribs between v
i
and v
j
.
A
B
B
G
A
B
B
G
A
0
1
1
0
B
1
0
0
1
B
1
0
0
1
G
0
1
1
0
4. Incident matrix
B[i][j] = 1 if v
i
incident e
j
The lines are the tops, the columns are the ribs.
A
B
B
e1
e2
05
Types of graphs
Simple, complete, zero-graph, cartoon, wood, wood
Earl
No hinges, no parallel ribs.
A
B
Full K
n
Each pair of vertices is adjacent.
A
B
B
G
Zero-graph
Lots of ribs empty, just the tops.
A
B
B
Multigrapher / Pseudograph
Parallel ribs and/or loops.
A
B
B
parallel.
loop
Tree
Contact box without cycles. E = V - 1.
A
B
B
Forests
An unrelated graph, each component is a tree.
A
B
B
G
D
E
No communication
06
Routes and routes
Route ♪ Chain ♪ Way ♪ Cycle ♪
Jerarchy of routes
Route
- a sequence of vertebrates and ribs.
Chain
- route where
All ribs are different.
.
Path
- A chain where
All the tops are different.
.
Cycle
- closed path (first summit = last)
Маршрут
⊆
Цепь
⊆
Путь
|
Цикл
= замкнутый путь
🗺
Tracks on graph: Interactor
v1
v2
v3
v4
The properties of tracks and cycles
The degree of non-continuous top of the path = 2, end = 1.
Each top of the cycle has an even degree.
The number of tops of the path = the number of ribs + 1; in the number cycle the number is equal.
07
Linkage of graphs
Connectivity components
Contact box
- there's a way between each pair of vertices.
Connectivity component
- maximum contact sub-graph.
Example: 3 components
v1
v2
v3
component 1
v4
v5
v6
component 2
v7
component 3
08
Top degree. Regular graphs
Maximum, minimum, regular rows
Degree
Leg(v) is the number of random ribs.
Δ(G)
- maximum,
δ(G)
- minimum degree.
Regular Count
degrees r — all the vertebrates have the same degree.
Σ deg(v) = 2E
| Число нечётных степеней — чётно
09
Eilers and Hamilton Cycles
♪ Ribs vs round the tops ♪
Eleric Cycle
Closed route passing
Each rib is exactly one time
.
Критерий:
все вершины имеют чётную степень
Эйл. цепь:
ровно 2 вершины нечётной степени
Flary's algorithm:
Go through the rib without cutting the component.
Challenges:
Mail delivery, network inspection, memory testing
1
2
3
4
5
6
Hamilton cycle
Cycle passing
each top is exactly one time.
.
Задача коммивояжёра:
найти гамильтонов цикл
минимального веса
History:
Hamilton is the task of bypassing 20 Dodecaedre tops.
Application:
Planning, scheduling, testing of LSAs
1
2
3
4
5
Comparison
Eulers
Hamiltons
It's going around.
each rib
each top
Criterion
known (even degrees)
unknown
Algoritm
Flury — Polynomial
over-the-board — exponential
Complexity
O(E)
NP full
10
Associated matrix: Interactor
Real-time row and matrix
GEF
OGE No. 4
EGE No. 1
🔗
Construction of a related matrix
Grape type:
Upper:
Push two vertices in a row to switch the rib.
Robert:
0
11
Mini-test: 5 questions
XP: 0