Assignment 1: Matchings
Assignment 1: Matchings
Assignment 1: Matchings
You may work with a couple of friends. As a last resort, you may even use
some other written resources but you must cite them. In all cases you must
write up your own solutions in your own words.
1. Girl-Proposal Algorithm. Run the girl-proposal algorithm to find a set of stable
marriages for the following lists of preferences. Show your work on each step.
What is Girls 3s favourite valid partner? What is Boy 3s least favourite?
Boy 1: G1 G2 G3 G4
Boy 2: G4 G3 G1 G2
Boy 3: G1 G2 G4 G3
Boy 4: G1 G4 G2 G3
Girl 1: B1 B3 B2 B4
Girl 2: B4 B1 B2 B3
Girl 3: B3 B2 B1 B2
Girl 4: B1 B4 B2 B3
2. Stable Paths Problem.
The Border Gateway Protocol is a network protocol to allow subnetworks to
choose how they route packets across neighbhouring (peering) domains (called
autonomous systems). One simplified model for the protocol is to consider
a graph G = (V, E) where elements of V represent the domains and edges
represent peering relationships. For each destination vertex t V , the vertices
of V t must collectively decide how they will route their packets to t. This
is done in a distributed fashion as follows. At any time, each vertex v V t
announces the path Pv (sequence of vertices) it is currently using to route to t. If
some other vertex u prefers to route its packets via v, then it starts announcing
a new path Pu = u, Pv .
A stable paths configuration is one where everyone is happy with their current
path. In other words,
if for some vertex u, it is announcing the path Pu = u, v1 , v2 , . . . , t. Then
every vertex vi along this path has chosen the particular subpath Pvi =
vi , vi+1 , . . . , t.
1