GithubHelp home page GithubHelp logo

danielgribel / assortativesbm Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 96 KB

Source code of AC-DC-SBM, from "Assortative-Constrained Stochastic Block Models" (Gribel, Vidal and Gendreau, 2020)

Julia 82.24% R 17.76%
sbm community-detection constrained-optimization

assortativesbm's Introduction

AC-DC-SBM

Assortative-Constrained Stochastic Block Models

Run

To run the AC-DC-SBM algorithm in Julia, try the following command:

> julia AC_DCSBM.jl 'dataset_name' seed nb_runs

Example

> julia AC_DCSBM.jl 'A-4-05-02-101' 1234 100

Data format

Graph file. The graph file is a 3-column and m-row file, where m is the number of edges in the graph. Each column is separated by a single space, and each line correponds to one edge in the graph. In a row, the first value is the number of the first sample, the second value is the number of the second sample, and the third value is the weigth of the edge:

a1 b1 w1
a2 b2 w2
... ... ...
am bm wm

Important: Graph files must have the .link extension. Some graphs are provided within the folder /data in this repository.

Label file. The label file contains the ground-truth community of each sample of the dataset, and is a N-row file, where N is the number of samples. Each line presents the label of the i-th sample:

y1

y2

...

yN

Important: Labels files must have the .label extension. Some labels are provided within the folder /data in this repository.

assortativesbm's People

Contributors

danielgribel avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

vidalt

assortativesbm's Issues

Optimization errors with k > 7~ and poor scaling with k

Testing on empirical networks I noticed that past around 7 communities the constrained optimization will fail sometimes,

 Warning: Problem status NUMERICAL_ERROR; solution may be inaccurate.

Also that the optimization succeeded is never checked. I think spurious solutions can be accepted. Tweaking it to just ignore those cases in eval_relocate is easy enough

solve!(problem, ECOS.Optimizer(verbose=false))

# println("Optval = ", -problem.optval)
return problem.status, -problem.optval
problem_status, sbm_cost = solve_convex(sol.data, m_, kappa_, omega)

if sbm_cost < sol.ll && problem_status == Convex.MOI.OPTIMAL

I'm not sure if there is some ECOS setting that can be tweaked to solve these problematic cases or not. Around the same number of communities (7~) (and above) the algorithm slows down considerably. When I flip the CONSTRAINED flag the algorithm doesn't slow down noticeably at the same point. I wonder now if these optimization errors can be worked around will the algorithm scale more closely with the unconstrained case?

Thanks for any thoughts

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.