akellehe / graphism Goto Github PK
View Code? Open in Web Editor NEWSimulates various models on network graphs.
Simulates various models on network graphs.
Implement recover() in the Graph object (called on each infected node) and in the Node object (to be called by Graph).
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
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.
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.
graphism.graph.Graph has no default infection callback function. set it to something that just prints the node name, and that it's infected.
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.
http://en.wikipedia.org/wiki/Flow_network
Capacity should be proportional to the weight (and multiplicity) of an edge.
graphism.graph.Graph has no default Graph.propagate() method. set it to coin flip probability: 50/50 chance of getting infected.
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.
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() )
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).
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.