Coder Social home page Coder Social logo

phasme's Introduction

Phasme

Graph with ASP made easy.

Use cases

Write an ASP graph into gexf

phasme convert data.lp target.gexf

Rewrite a gml graph with normalized node names

phasme convert data.gml --normalized

Extract the biggest cc, write it anonymized in gml

phasme split data.lp --biggest-first "data_cc.lp" --slice 0 1
phasme convert data_cc_1.lp target.gml --anonymized

Generate a small world graph in gml

phasme generate data.gml erdos_renyi_graph n=100 p=0.01

Packaging

pip install phasme

Will also populate your env with the executable phasme, enabling access to the CLI.

CLI commands

CLI provides access to higher level routines.

  • split: split by connected component.
  • info: give info about given graph.
  • convert: rewrite, anonymize, normalize or convert the graph to (clean) ASP or standard format.
  • generate: generate a graph using a given generation method.

Other examples

# split a graph by cc
python -m phasme split data.lp -o "data_{}.lp"

# get infos
python -m phasme infos data.lp --graph-properties

# there is a shitload of options
python -m phasme infos --help

# conversions between formats
python -m phasme convert data.lp data.gml --anonymize

# generation of new graphs to play with
python -m phasme generate graph.gml powerlaw_cluster_graph n=5 m=2 p=0.01

# ready-to-draw tikz visualization of ASP graph
python -m phasme convert data.lp graph-in-latex-tikz.tex

# randomize a graph, keeping the same degree distribution, using switching method
python -m phasme randomize data.lp randomized-graph.gml

Changelog

  • 0.0.14
  • 0.0.13
    • randomize: --per-cc option to run it on each connected component independantly
  • 0.0.12
    • new subcommand: randomize, to build a random graph based on another
    • new subcommand: extract, to extract subgraphs based on their nodes
    • convert: new output format: latex/tikz
    • infos: give infos on articulation points
    • infos: indicate number of self loops, if any, or give property 'no loop'

phasme's People

Contributors

aluriak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pawsenn

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.