Randomized Algorithms CS648

40
Randomized Algorithms CS648 Lecture 21 Random Walk and Electric Networks 1

description

Randomized Algorithms CS648. Lecture 21 Random Walk and Electric Networks . Overview and motivation . What do we know about Random walk till now?. We have discussed uniform random walk on A line . A complete graph . Two complete graphs joined by an edge (Mid- sem Exam). - PowerPoint PPT Presentation

Transcript of Randomized Algorithms CS648

Page 1: Randomized Algorithms CS648

Randomized AlgorithmsCS648

Lecture 21Random Walk and Electric Networks

1

Page 2: Randomized Algorithms CS648

OVERVIEW AND MOTIVATION

2

Page 3: Randomized Algorithms CS648

What do we know about Random walk till now?

We have discussed uniform random walk on β€’ A line.β€’ A complete graph.β€’ Two complete graphs joined by an edge (Mid-sem Exam).

We analyzed the random walk by writing equation for each case. We could solve these equations because of β€’ Symmetry of the our graphs (line graph, complete graph).β€’ Uniformity of random walk.

Question: Is there a compact formula for expected duration of a random walk on any graph ? What if the random walk is not uniform ?

3

Page 4: Randomized Algorithms CS648

An answer from mathematics

Let be an undirected graph on vertices and edges.

Theorem: Let . Expected length of a random walk that starts from and terminates on reaching is .

The above result is derived using theory of Markov Chains. Unfortunately, it is a loose result for many graphs .

Exercise: Show that for complete graph, the above result is very loose.

4

Page 5: Randomized Algorithms CS648

A surprising discoveryβ€’ Random walk on a graph is closely related to electric networks.

β€’ A graph can be viewed as a electric network where each edge corresponds to a resistance of one ohm.

β€’ Various aspects of random walk are defined as a fundamental characteristics (resistance, power, voltage) of the corresponding electric network.

Physics of electric network helps in mathematical theory of random walk !

Isn’t it surprising ?5

Page 6: Randomized Algorithms CS648

A WARM UP EXAMPLE

6

Page 7: Randomized Algorithms CS648

Random walk on a line

Question: Suppose the random walk starts at . What is the probability that the drunkard reaches home before reaching bar ?

Let be the corresponding probability. ? ? ?

7

𝟎 𝟏 π’Šβˆ’πŸ π’Š+πŸπ’Š π’π’βˆ’πŸ

Β½ Β½

homebar

πŸŽπŸπŸπŸπ’‘ (π’Šβˆ’πŸ )+𝟏𝟐 𝒑 (π’Š+𝟏 )

Page 8: Randomized Algorithms CS648

𝟎 𝟏 π’Šβˆ’πŸ π’Š+πŸπ’Š π’π’βˆ’πŸ

Random walk on a line

: Potential at point . , ,Current entering = Current leaving . =

9

Volt

current

Each resistance is 1 ohm.

Page 9: Randomized Algorithms CS648

Random walk on a line

, ,

: Potential at point , ,

Hence and satisfy the same set of equations. Since these equations have unique solution, therefore for all .

𝟎 𝟏 π’Šβˆ’πŸ π’Š+πŸπ’Š π’π’βˆ’πŸ

Β½ Β½

homebar

𝟎 𝟏 π’Šβˆ’πŸ π’Š+πŸπ’Š π’π’βˆ’πŸ

Volt

current

Page 10: Randomized Algorithms CS648

Generalization to graphs

Question: What is , probability of reaching home before bar ?,,

11

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

home

bar

Page 11: Randomized Algorithms CS648

Generalization to graphs

Question: What is relation between and ’s where ?,,Net current leaving is 0.

12

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 12: Randomized Algorithms CS648

Generalization to graphs

Question: What is relation between and ’s where ?,,

Hence and satisfy the same set of equations. Since these equations have unique solution, therefore for all .

13

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

,,

Page 13: Randomized Algorithms CS648

Generalization to graphs

Exercise: Use your knowledge of electric circuits to find exact value of in the above circuit. This will also be the value of .

Try to realize that you would not have been able to calculate using other mathematical tools that you are aware of.

Isn’t it surprising.Fully internalize it before proceed further for another more surprising result. We shall revise the theory of electric circuits which perhaps you might have forgotten by now.

14

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 14: Randomized Algorithms CS648

REVISITINGTHEORY OF ELECTRIC CIRCUITS

15

Page 15: Randomized Algorithms CS648

Kirchoff’s Current Law

For any node in the circuit,Current entering node = Current leaving node

Note: This law holds for the entire circuit as well. For example,Let the above circuit is connected to outside circuit through wires at nodes .Question: If 5 Amperes of current enters and 10 Amperes of current enters from outside, then what current leaves/enters ?Answer: 15 Amperes of current must leave .

17

𝒖

𝒃

𝒂

𝒙

π’š

𝒛

5 A

10 A15 A

Page 16: Randomized Algorithms CS648

Notion of Resistance and Ohm’s Law

The current passing through a piece of wire is proportional to the potential difference applied across the two ends of it. The constant of proportionality is called β€œresistance”.

Thus the resistance can be defined in terms of voltage and current as follows.

The resistance of a wire is the potential difference that needs to be applied across its ends to pass a current of 1 ampere through it.

18

𝒂 𝒃𝑹

𝑰

Page 17: Randomized Algorithms CS648

Notion of Resistance and Ohm’s Law

What made you conclude that the resistance between and is ? β€’ Series lawβ€’ Parallel lawThis introduces the notion of effective resistance between two points and in a given circuit.Question : In a circuit, if we increase (decrease) the value of any resistance, what will be its effect on effective resistance between and ?Answer: the effective resistance between and may only increase(decrease).

19

πŸπ›€

πŸπ›€πŸπ›€

πŸπ›€πŸπ›€

𝒂 𝒃

Page 18: Randomized Algorithms CS648

Notion of Resistance and Ohm’s Law

If amperes of current flows from to , then β€’ : the potential difference from to or the potential of relative to

β€’ Relation between and ?

Question: What is if is not directly connected to in the circuit ? (see next slide)

20

𝒂 𝒃𝑹

𝑰

Page 19: Randomized Algorithms CS648

Electric Potential is conservative

Question: What is ? (the battery and other wires not shown in the figure above)Answer: Consider any path from to . is the sum of the potential difference at each edge on this path.

FACT: is path independent (electric potential is conservative).

21

𝒖

𝒃

𝒂

𝒙

π’š

𝒛

Page 20: Randomized Algorithms CS648

Three simple principles

Fully understand these principles so that you may apply them later on.

22

Page 21: Randomized Algorithms CS648

Reversibility

Let be a valid current flow in a circuit.

Question:Let be a flow obtained by reversing the direction of current flow in each branch of circuit.is also a valid current flow in the circuit ?Answer: Yes.

Question: Let β€’ be potential of relative to for the flow .β€’ be potential of relative to for the flow . What is relation between and ?Answer:

23

Page 22: Randomized Algorithms CS648

Linearity of current flow

Let and be any two valid current flows in a circuit.

Question: Is + a valid current flow ?Answer: Yes.

Question: Let β€’ be potential of relative to for the flow .β€’ be potential of relative to for the flow . What is potential of relative to in + ?Answer:

24

Page 23: Randomized Algorithms CS648

Uniqueness

If we assign any assignment of potential to nodes in the above circuit, there exists a unique and valid current flow in the circuit satisfying these potential. However, note that, this will require that you connect external wires to allow residual current to enter/leave a node to satisfy Kirchoff’s law.

Interestingly the converse of the above rule is also true .

25

𝒖

𝒃

𝒂

𝒙

π’š

𝒛

Page 24: Randomized Algorithms CS648

Uniqueness

If we inject and extract any arbitrary amount of current into a circuit from outside, then provided that the current satisfies Kirchoff’s law (net current into circuit is 0), the current distributes itself within the circuit to give a unique and valid assignment of potentials to all nodes.

The reason behind this uniqueness principle lies in the fact that there is a set of linear equations for each circuit on the basis of Kirchoff’s law and Ohm’s law. These equations have a unique solution. Interested students might like to explore this fact. But for this course, it is fine if you just understand this principle of uniqueness.

26

𝒖

𝒃

𝒂

𝒙

π’š

𝒛

15 A10 A

5 A 15 A

2 A

3 A

Page 25: Randomized Algorithms CS648

Random walk and electric networks

27

Page 26: Randomized Algorithms CS648

Notations

β€’ Hitting time : Expected no. of steps of the walk that starts from and finishes as soon as it reaches . Question: Any relation between and ?

β€’ Commute time : Expected no. of steps of the walk that starts from and finishes at after visiting at least once.

28

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

NO

Page 27: Randomized Algorithms CS648

Expressing through a circuit

29

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 28: Randomized Algorithms CS648

Expressing through a circuit

When there is no external current into ,Question: What is relation between and ’s where ? β€’ An additive term of in equation of is missing in the equation of . Why ? β€’ No numerical additive term appears in the equation of because we derived it

assuming net current into is 0.β€’ So in order to make the two equations similar, we need to augment the above

circuit with external wires.

30

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 29: Randomized Algorithms CS648

Expressing through a circuit

Let be the current injected into from outside.Question: What be the new relation between and ’s where ? Question: What should be in order to equate equations of and ?Observation: To equate with for each , we need to inject current of into each node . We must extract current from to satisfy Kirchoff’s current law.

31

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

𝑰 𝒙=deg (𝒙)

Page 30: Randomized Algorithms CS648

Expressing through a circuit

is the potential of relative to in circuit with the following current flow : 1. Inject current into each , 2. Extract current from .

It follows from the uniqueness principle that will be a valid current flow in the circuit.

In a similar manner, could you express ?

32

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 31: Randomized Algorithms CS648

Expressing through a circuit

is the potential of relative to in circuit with the following current flow : 1. Inject current into each , 2. Extract current from .

33

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 32: Randomized Algorithms CS648

+ = ??

in circuit() with current flow .

in circuit() with current flow . 34

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Apply principle of Reversibility

Page 33: Randomized Algorithms CS648

+ = ??

in circuit() with current flow .

in circuit() with current flow . 35

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Apply principle of Linearity

Page 34: Randomized Algorithms CS648

+ = ??

in circuit() with current flow .Question: What does the circuit() with current flow look like ?Hint: External current cancels at each node except at and .

36

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

Page 35: Randomized Algorithms CS648

+ = ??

in circuit() with current entering and current leaving . , where is the effective resistance between and .

37

𝒗 𝒖

𝒃

𝒂

𝒙

π’š

𝒛

𝒄

π’…π’ˆ

2π‘š2π‘š

Page 36: Randomized Algorithms CS648

Theroem: Given an undirected graph on edges, commute time between any pair of vertices and is , where is the effective resistance between and in the circuit associated with .

38

Page 37: Randomized Algorithms CS648

Commute Time of some well studied graphs

39

Page 38: Randomized Algorithms CS648

Useful tips

You may use one or more of the following principles to calculate effective resistance any pair of vertices and .

β€’ Increasing resistance of some edges to infinity (equivalent to removal of those edges) will only increase the effective resistance between and .

β€’ Apply series and parallel law of resistance can be a useful tool sometimes.

β€’ Any flow from to in the circuit will consume same or more amount of power than the corresponding current flow of same value from to . So effective resistance between any pair of vertices is bounded by the power dissipated due to any flow of 1 ampere from to in the circuit. (This is called the least power law)

40

Page 39: Randomized Algorithms CS648

Two complete graphs joined by an edge

Let and be two complete graphs on vertices. We add an edge between a vertex in and a vertex in . What is the maximum commute time in this combined graph ?

41

Page 40: Randomized Algorithms CS648

GridGiven -by- grid, calculate commute time between vertices and .Use least power law, and distribute 1 ampere of current evenly from to .

(the solution was sketched in the lecture class)42

𝒖

𝒗