We continue discussing the paper by Papadimitriou - Algorithms, Games and Internet. We started with Nash equilibrium and then we discussed Internet Equilibria. We viewed the latter in terms of multi commodity flow network where the maximum total flow in a subgraph is in the core of a coalition game. we saw the definition of core to hint at optimal set. Next we looked at markets. Markets are known for price equilibrium. and then we discussed mechanism design problems.
Next we discussed privacy and clustering. Then we reviewed web-graph. The web graph is considered as a directed graph with the documents as nodes and the hyperlinks as edges but it is notoriously different from a classical graph.The deviations from classical graph have prompted many other efforts to model the web graph. One such approach is the heavy tailed distribution which is interesting because it seems to have parallels in other domains. The population of xth largest city of any country is cx^(-1) with c depending on country.
The xth largest indegree or outdegree in a web graph is about c.x^(-alpha) where c and alpha are positive instead of the Gaussian predicted by the law of large numbers.
#codingexercise
/* Multiply contents of two linked lists */
double multiplyTwoLists (Node first, Node second)
{
double num1 = 0;
double num2 = 0;
while (first != null || second != null)
{
if(first != null){
num1 = num1*10 + first.data;
first = first.next;
}
if(second != null)
{
num2 = num2*10 + second.data;
second = second.next;
}
}
return num1*num2;
}
double multiplyTwoLists(List<int> first, List<int>second)
{
var ret = new List<int>(first.count+second.count){0};
int iteration = 0;
for (int i = second.count()-1; i >=0; i--)
{
int multiplier = second[i];
int carryover = 0;
int j = ret.Count - 1 - iteration;
for (int k = first.count()-1;k >=0; k--)
{
var product = first[k]*second[i];
product += ret[j];
product += carryover;
var value = product %10;
ret[j] =value;
carryover = product / 10;
j--;
}
If ( I ==0)
{
While(carryover)
{
Ret[j]= carryover%10;
Carryover /= 10;
J--;
}
}
iteration++;
}
return ret.ToNumber();
}
List<int> multiplyTwoLists(List<int> first, List<int> second)
{
Double num1 = first.ToDouble();
Double num2 = second.ToDouble();
Double result = num1 x num2;
Return result.ToList();
}
Next we discussed privacy and clustering. Then we reviewed web-graph. The web graph is considered as a directed graph with the documents as nodes and the hyperlinks as edges but it is notoriously different from a classical graph.The deviations from classical graph have prompted many other efforts to model the web graph. One such approach is the heavy tailed distribution which is interesting because it seems to have parallels in other domains. The population of xth largest city of any country is cx^(-1) with c depending on country.
The xth largest indegree or outdegree in a web graph is about c.x^(-alpha) where c and alpha are positive instead of the Gaussian predicted by the law of large numbers.
#codingexercise
/* Multiply contents of two linked lists */
double multiplyTwoLists (Node first, Node second)
{
double num1 = 0;
double num2 = 0;
while (first != null || second != null)
{
if(first != null){
num1 = num1*10 + first.data;
first = first.next;
}
if(second != null)
{
num2 = num2*10 + second.data;
second = second.next;
}
}
return num1*num2;
}
double multiplyTwoLists(List<int> first, List<int>second)
{
var ret = new List<int>(first.count+second.count){0};
int iteration = 0;
for (int i = second.count()-1; i >=0; i--)
{
int multiplier = second[i];
int carryover = 0;
int j = ret.Count - 1 - iteration;
for (int k = first.count()-1;k >=0; k--)
{
var product = first[k]*second[i];
product += ret[j];
product += carryover;
var value = product %10;
ret[j] =value;
carryover = product / 10;
j--;
}
If ( I ==0)
{
While(carryover)
{
Ret[j]= carryover%10;
Carryover /= 10;
J--;
}
}
iteration++;
}
return ret.ToNumber();
}
List<int> multiplyTwoLists(List<int> first, List<int> second)
{
Double num1 = first.ToDouble();
Double num2 = second.ToDouble();
Double result = num1 x num2;
Return result.ToList();
}
No comments:
Post a Comment