You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given lower bound $a$ and upper bound $b$, calculate the mid (average) value $c$ and sub into $f(x)$. Then adjust the bounds $a, b$ to move closer to the value closer to $0$.
1212
1218
@@ -1454,7 +1460,7 @@ As you can see, they are also very sensitive to input 😢
1454
1460
1455
1461
Forward propagation is the initial phase of data processing in a neural network. Here, input data is fed into the network and passed through various layers. Each neuron in these layers processes the input and passes it to the next layer, ultimately leading to the output layer. Thisprocess is linear and straightforward, moving in one direction: from input to output.
@@ -89,27 +89,28 @@ A path can contain many edges, or a single. it depends on what nodes are being s
89
89
90
90
!!! note
91
91
92
-
- [Euler paths](#euler-path) and [Euler circuits](#euler-circuit):
93
-
- Can pass through [nodes](#nodes) more than once.
94
-
- Don't exist if a graph has more than two vertices of odd degree.
95
-
- Exists if all vertices of a graph have even degree.
96
-
- Exists if a connected graph has exactly two odd vertices. The starting point must be one of the odd vertices and the ending point will be the other of the odd vertices.
97
-
98
-
- [Hamiltonian Paths](#hamiltonian-path)
99
-
- Don't have to traverse every [edge](#edges)
92
+
- Check out [Euler paths](#euler-path) and [Euler circuits](#euler-circuit):
93
+
- Check out [Hamiltonian Paths](#hamiltonian-path)
100
94
101
95
102
96
#### Euler Path
103
97
104
98
A [path](#paths) that uses each [edge](#edges) once only without returning to starting [vertex](#nodes) is an Euler path.
105
99
106
-
- Uses each **edge** once
100
+

101
+
107
102
- Doesn't return to starting vertex
103
+
- Can pass through [nodes](#nodes) more than once.
104
+
- Don't exist if a graph has more than two vertices of odd degree.
105
+
- Exists if all vertices of a graph have even degree.
106
+
- Exists if a connected graph has exactly two odd vertices. The starting point must be one of the odd vertices and the ending point will be the other of the odd vertices.
108
107
109
108
#### Euler circuit
110
109
111
110
A [path](#paths) that uses each [edge](#edges) once only and returns to starting [vertex](#nodes) is an Euler circuit.
112
111
112
+

113
+
113
114
If an undirected graph $G$ is connected and every vertex (not isolated) in $G$ has an even degree, then $G$ has an Euler circuit.
114
115
115
116
- Uses each **edge** once
@@ -119,15 +120,24 @@ If an undirected graph $G$ is connected and every vertex (not isolated) in $G$
119
120
120
121
A [path](#paths) that passes every [vertex](#nodes) exactly once without returning to starting [vertex](#nodes) is an Hamiltonian path.
121
122
123
+

124
+
122
125
- Uses every **node** once
123
126
- Doesn't return to starting node
127
+
- Don't have to traverse every [edge](#edges)
124
128
125
129
#### Hamiltonian Circuit
126
130
127
131
!!! note
128
132
129
133
This is used very often in this course. See [Travelling salesmen problem](algorithms.md#travelling-salesmen-problem)
130
134
135
+
!!! important
136
+
137
+
A [cycle](#cycle) and a [circuit](#circuit) are different. But the properties of both Hamiltonian cycles and Hamiltonian circuits are the same. Hence they reffer to the same thing.
A [path](#paths) that passes every [vertex](#nodes) exactly once and returns to the starting [vertex](#nodes) is an Hamiltonian path.
132
142
133
143
- Uses every **node** once
@@ -145,16 +155,28 @@ Is there a path from $A$ to $B$ ?
145
155
146
156
The transitive closure of a graph is a graph which contains an edge between $A$ and $B$ whenever there is a directed path from $A$ to $B$. In other words, to generate the transitive closure every path in the graph is directly added as an additional edge.
Which is the absolute cell distance in the $x$ direction plus the absolute cell distance in the $y$ direction. The absolute value is always positive.
268
287
@@ -279,9 +298,9 @@ Also known as a topological ordering
279
298
280
299
In computer science a **topological sort** or **topological ordering** of a [Directed Graph](#directed-graph) is a linear ordering of its [vertices](#nodes) such that for every directed edge _uv_ from vertex _u_ to vertex _v_, _u_ comes before _v_ in the ordering.
281
300
282
-
A topological ordering is possible iff the graph has no directed cycles, that is, if it is a directed acyclic graph ([Dag DAGS](#dag-dags)).
301
+
A topological ordering is possible iff the graph has no directed cycles, that is, if it is a directed acyclic graph ([Dag - DAGS](#dag-dags)).
The graph shown above has many valid topological sorts, including:
287
306
@@ -302,7 +321,7 @@ This can be calculated through [Kahn's Algorithm](#kahns-algorithm)
302
321
303
322
A [Topological sort](#topological-sort) algorithm, first described by **Kahn** (1962), works by choosing vertices in the same order as the eventual topological sort. First, find a list of "start nodes" which have no incoming edges and insert them into a set $S$; at least one such node must exist in a non-empty acyclic graph. Then:
304
323
305
-
```js
324
+
```js title="Kahn's Algorithm in psuedocode"
306
325
L ← Empty list that will contain the sorted elements
307
326
S ← Setof all nodes with no incoming edges
308
327
@@ -319,11 +338,13 @@ else
319
338
returnL (a topologically sorted order)
320
339
```
321
340
322
-
### Graph Diameter
341
+
### Graph Diameter and radius
323
342
324
343
!!! note
325
344
326
-
Note that the **diameter** is the max graph ecentricity. The radius of the graoh requires a center point to be defined
345
+
Note that the **diameter** is the max graph ecentricity. The radius of the graph requires a center point to be defined
346
+
347
+

327
348
328
349
The longest shortest path between any two nodes counted by edge and weights.
329
350
@@ -337,11 +358,12 @@ The examples below have a diameter of 2 (2 edges to traverse to get from a to b)
*Note that the radius and diameter is counted by the number of edges
343
366
344
-
---
345
367
346
368
## Network graphs
347
369
@@ -374,13 +396,13 @@ We can then obtain $H$ from $G$ by deleting edges and or vertices from $G$.
374
396
375
397
#### Simple graph
376
398
377
-
A simple graph, also called a strict graph is **an unweighted, undirected graph containing no graph loops or multiple edges**.
399
+
A simple graph, also called a strict graph is **an unweighted, [undirected graph](#undirected-graphs) containing no graph [loops](#loops) or multiple edges**.
378
400
379
-
A simple graph may be either connected or disconnected. Unless stated otherwise, the unqualified term "graph" usually refers to a simple graph.
401
+
A simple graph may be either connected or [disconnected](#disconnected-graph). Unless stated otherwise, the unqualified term "graph" usually refers to a simple graph.
For simple [**connected graphs**](#connected-graph) the amount of edges you can have are striclty bounded by:
405
+
For simple [**connected graphs**](#connected-graph) the amount of edges you can have are striclty bounded. The number of edges will always be between the arrangement of a [tree](#trees) or a [complete graph](#complete-graphs):
384
406
385
407
$$
386
408
\overset{\text{(trees)}}{(|V|-1)}
@@ -391,20 +413,24 @@ $$
391
413
392
414
#### Multigraph
393
415
416
+
{width=300px}
417
+
394
418
A graph that can have multiple edges between the same pair of nodes. In a road network this could, for example, be used to represent different routes with the same start and end point.
395
419
396
420
#### Connected Graph
397
421
422
+
{width=500px}
0 commit comments