In [65]:
using Laplacians
using DataStructures
include("../src/flowClustering.jl")
include("../src/cutHeuristics.jl")
include("../src/localClustering.jl")
Out[65]:
In [34]:
a = readIJ("/Users/serbanstan/Downloads/emailEnron.txt", '\t');
In [74]:
a = chimera(10000)
include("../src/localClustering.jl"); @time s = prn_local(a, [1], 0.5, 1)
println(length(s))
In [77]:
minEpsSigma = getVolume(a, s) / getVolume(a, setdiff(collect(1:max(a.n, a.m)), s))
@time cut, flow = localImprove(a, s, epsSigma = minEpsSigma, err = 1e-5, maxSize = 10000);
condcut = compConductance(a, cut)
@time heur_refcut = refineCut(a, s)
condref = compConductance(a, heur_refcut)
@time heur_dumb = dumb(a, s)
conddumb = compConductance(a, heur_dumb)
Out[77]:
In [78]:
println(compConductance(a, s), " ", length(s))
println(condcut, " ", length(cut))
println(condref, " ", length(condref))
println(conddumb)
In [ ]:
In [ ]:
In [ ]:
for i in 1:30000
println("************ ", i)
a = chimera(30000)
s = prn_local(a, [i], 0.5, 1)
println(length(s))
if length(s) > 0
minEpsSigma = getVolume(a, s) / getVolume(a, setdiff(collect(1:max(a.n, a.m)), s))
@time cut, flow = localImprove(a, s, epsSigma = minEpsSigma);
condcut = compConductance(a, cut)
@time heur_refcut = refineCut(a, s)
condref = compConductance(a, heur_refcut)
@time heur_dumb = dumb(a, s)
conddumb = compConductance(a, heur_dumb)
println(compConductance(a, s), " ", length(s))
println(condcut, " ", length(cut))
println(condref, " ", length(heur_refcut))
println(conddumb, " ", length(heur_dumb))
end
end
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
a = chimera(1000000)
@time s = prn(a, [1,2,3], 0.5, 3);
@time s2 = prn_local(a, [1,2,3], 0.5, 3);
In [ ]:
for i in 1:100
a = chimera(100)
s = prn(a, [1,2,3], 0.5, 3); #println(compConductance(a, s))
s2 = prn_local(a, [1,2,3], 0.5, 3); #println(compConductance(a, s2))
c1 = compConductance(a, s)
c2 = compConductance(a, s2)
if c1 != c2
println(i, "? ", c1, " ", c2)
end
end