[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] R-implementations of games
From: |
Arthur Kaiser |
Subject: |
[igraph] R-implementations of games |
Date: |
Mon, 01 Feb 2010 20:58:12 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.7) Gecko/20100111 Thunderbird/3.0.1 |
Hallo,
do R-implementations of games exist?
I especially need a R-implementation of aging.prefatt.game.
Here is an example of a simple barabasi.game implementation:
my.ba.game<-function(n, directed){
graph<-graph.empty(directed)
graph<-add.vertices(graph, 1) #add first vertex
for(i in 1:n){
# snapshot
# if(i==x) {write graph}
# and the rest
graph<-add.vertices(graph, 1) #add a vertex
startvertices<-graph[4][[1]] #in degree
maxj<-length(startvertices)
j<-sample(1:maxj, 1)
vj<-startvertices[j] #to
if(maxj==0){graph<-add.edges(graph, c(i,0))
}else{graph<-add.edges(graph, c(i, vj))}
graph<-simplify(graph)
}
return(graph)
}
Are you wondering why I ask for this? I need snapshots of the graph
during the generation process. I also want to combine games e.g. ba with
a d-dim latice or a randoom game without writing it in c and compile.
Can someone help me please?
Thanks in advance.
Arthur Kaiser
University of Applied Sciences Brandenburg
Faculty of Computer Science and Media
- [igraph] R-implementations of games,
Arthur Kaiser <=