Giter VIP home page Giter VIP logo

graphism's People

Contributors

akelleh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

graphism's Issues

Implement recover() methods

Implement recover() in the Graph object (called on each infected node) and in the Node object (to be called by Graph).

0 node causes errors with graphism.graph.Graph( edgelist )

If you create an edgelist with "0" as one of the node names, you get several extra nodes with decimal names. for example, the edgelist [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]
produces the following nodes:
0.7880429831781368044446.11
0.9310705061681368044446.11
2
1

write method for Graph() objects to return edgelist

add a method to graphism.Graph() objects that return the edgelist of the graph. it should be the same format as the edgelist you pass to Graph() when the graph is constructed, with the optional 3rd argument for each edge specifying its weight.

write a method to change the transmission_probability and recovery_probability functions

the transmission_probability and recovery_probability functions of the Graph object should be changeable after the object is initialized, and not just at initialization. It'd be nice if I could generate particular graphs to be useful for different cascade studies, so I need to be able to modify those cascade properties after the graphs are constructed.

implement graph.remove_recovered()

in analogy with the graph.remove_infected() and graph.remove_susceptible() methods, add a graph.remove_recovered() method to the graph package that takes a node or list of nodes,and removes those nodes from the recovered list, and adds them to the susceptible list.

set default propagate method

graphism.graph.Graph has no default Graph.propagate() method. set it to coin flip probability: 50/50 chance of getting infected.

implement access to the set of nodes in Graph.

A graph is defined, mathematically, as G = { E, V }, where E is the set of edges, and V is the set of vertices, or nodes. In keeping with that standard, we should have access to the set of nodes, V, through a basic method of graphism.Graph.

For g a graphism.graph.Graph object, calling

g.nodes()

should return the set of all nodes contained in the graph.

implement graph.reset()

We should be able to run several cascades on a single graph, so we want to be able to reset the graph to the state where all nodes are susceptible. i.e. remove all nodes from the infected and recovered lists, and add them all to the susceptible list. this method should do that.

(As a separate issue, there is no method to remove nodes from the recovered list, so I can't even write my own version of graph.reset() )

implement graph addition

Add a method to the Graph() object that allows adding other graphs.

for g and h both Graph() objects, g.add_graph(h) should return a graph containing the union of the nodes in g and h, and the sum of the edges. You should decide whether we want to 1) add new distinct edges, or 2) simply increase the weight of existing edges when we implement this.

the method should return an error if there exists a node in both g and h with the same name, but different and conflicting attributes (e.g. different edges connecting the same nodes are okay, but different user-defined internal properties are bad. we might need to discuss how to implement this).

implement edge.to_tuple()

Given an edge, we want access to the tuple (parent_node_name, child_node_name) so we can write the edgelist for the graph. the method of the Edge object called to_tuple() should return the tuple listed above, so that we could run , for example
edgelist = [edge.to_tuple() for edge in g.edges()]
for some Graph object g to get the edgelist in the standard format [(1,2),(2,3),...] for integer named edges.

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.