Code Monkey home page Code Monkey logo

l-cloning's Introduction

L-cloning

The file lcloning.py provides the function save_lcloned_edgelist that reads an edgelist from a textfile, generates a random L-cloned graph, and writes its edgelist into a new textfile. The original graph is assumed to be simple, unweighted, undirected and without self-loops. The name of the copies of each vertex in the L-cloned graph is appended "_##", where ## corresponds to the layer's number (between 0 and L-1).

The function can be called from another script

from lcloning import save_lcloned_edgelist

save_lcloned_edgelist(original_el_fname, l_cloned_el_fname, L, sep, comment, header)

where

original_el_fname : string
    path to the file containing the original edgelistin which each line
    corresponds to an undirected edge. The name of the two vertices are
    treated as strings and must correspond to the first two columns of
    each line.
l_cloned_el_fname : string
    path to the file that will contain the L-cloned edgelist
L : int
    number of copies
sep : string (optional; default: any white space)
    character(s) used to separate the columns on a single line
comment : string (optional; default: #)
    any line beginning with this character is ignored
header : bool (optional; default: True)
    add a header to the l-cloned edgelist

or can be executed by running

python lcloning.py original_el_fname l_cloned_el_fname L

See the validation notebook for further examples.

Reference

Network cloning unfolds the effect of clustering on dynamical processes
Ali Faqeeh, Sergey Melnik, and James P. Gleeson
Phys. Rev. E 91:052807 (2015)
doi: 10.1103/PhysRevE.91.052807

l-cloning's People

Contributors

antoineallard avatar

Watchers

 avatar  avatar

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.