2017年12月21日木曜日

Streaming algorithm

This is the process of data streaming with less memory.

x∈R^n


This is high dimensional vector.

You update it.

xi←xi+v


You have O(n) space, and the whole stream is O(m).


You compress the data by streaming.

A=(1±ε)B


(1-ε)B≦A≦(1+ε)B







σi,j = ±1, E[σi,j] = 0











2017年12月20日水曜日

Zeta transform


This is Inclusion-Exclusion.


Then, this is the Zeta transform.


Moreover, this is the inversion.


You prove this.


At first, you use the Zeta transform.


You put the inversion.


You remove the gray area.



You divide S and R.


This is Inclusion-Exclusion.


You got f(R).

Therefore, the Zeta transform is feasible.














2017年12月19日火曜日

Exponential Divide and Conquer

OPT(U,s,t) is the length of s and t, and you choose the cheapest.

You split the path into two halves in all possible ways. This is called Exponential Divide and Conquer.



m is an intermediate point.

|S|=||U|/2|+1


T∪S=U


T∩S=m



n is nodes.



ε>0

The exponential space is huge.


2017年12月13日水曜日

Minimum-cost flow problem

In a flow network, you need to choose the cheapest path.

This is the directed graph.

G=(V,E)


(u,v)∈E

This is the edge.

c(u,v)>0 (c is the capacity)
f(u,v)≧0 (f is the flow)
a(u,v) is the cost of the path.

The cost of sending this flow is f(u,v)*a(u,v).

You choose the cheapest.


This is the total cost of the flow over all edges.

f(u,v)≦c(u,v)

Then, you think the maximum cardinality matching in G that has minimum cost.

G=(A∪B,E)



G'=(V'=A∪B,E'=E)



The capacity of all the new edges is 1 and their costs is 0.












2017年12月8日金曜日

Link-cut Trees

Blocking flows make a tree because of O(logU). However, this is dynamic trees, so you can delete and insert nodes. There is no direction basically.

This is the algorithm.

initially, makeTree() n times
while(true):
v = findRoot(s)
if (v == t)
//(z,parent(z)) is a min capacity edge with weight x
(z,x) = findMin(s)
subtract(s,x)
cut(z)
delete(z,parent(z)) from the level graph
continue
else
//try to advance
if v has an outgoing edge to some w in L:
link((v,w),capacity(v,w))
else
if (v == s): break
else for every child y of v
cut(y)
delete(y,v) from L



The cost of splaying nodes is O(logU). The total number of preferred child changes is O(m logU).

2017年12月5日火曜日

Blocking flows

It is very hard to find your marriage partner in computer science. In modern society, the marriage means more complicated. Your partner may be animals. You have free choices. I don't care about that.


There is a path between S and T. This is the vector to find your partner. You choose the shortest way.


A blocking flow expand the administrative path with at least the one arc. Moreover, the max flow algorithm is to find the blocking flows.

Life is hard, so you can't go straight always. You need O(m) times to find blocking flows, so the running time of this max flow algorithm is O(mn).


U is the maximum capacity of an edge, and O(mn) is the expanded work. Therefore, the total running time of max flow for scaling blocking flows is O(mn log U).





2017年12月1日金曜日

The minimum fractional set cover problem

You hedge your marriage partner in computer science. You can use dating apps in your smart phones recently, so AI may decide your marriage life soon.


m is the cost vector which is yes or no.

F={S1,S2,・・・,Sm}


This is the Linear probing , so you concentrate on your favorite partner.



p is the hedge which is the vector.


p(S) is the total weight of elements in S.

This is the covering problems, so you search for the optimization by expanding.


L is the maximization of p(S).


(1-ε) is approximation algorithm for maximization.


This is feasible, so there is the possibility for your marriage life.