Learn R Programming

SteinerNet (version 2.0)

generate_st_samples: generate_st_samples

Description

This function generates simulation data. It creates random graphs with randomly selected terminals.

Usage

generate_st_samples(test, graph, folder= NULL, listofterminaltest, repetition)

Arguments

test

test selects the test type to make random data for it. the random walk for exact algorithm makes subgraphs that include random terminals, but for heuristics it selects random terminals on the base graph and returns the terminal set only

graph

graph is the base graph for generating random subgraphs and random terminal set.

folder

folder specifies a folder name to store the simulated data inside it.

listofterminaltest

listofterminaltest is an input list. Elements of the list are number of terminals to select for a simulation.

repetition

repetition is a list of probabilites. Its length declares the number of elements if random data set that is created for terminals. Each element of the list is the probability of selecting a node as terminal while the random walk is traversing the base graph.

Value

The function stores the random data in address that is stated in folder. When test is exact the output includes random subgraphs and random set of terminals. When test is appr the function returns random sets of terminals.

Details

This function generates random data for two type of simulations. For experiments that include exact algorithms, it generates random subgraphs with randomly selected terminals. Otherwise it returns only a set of random terminals to be used with the base graph.

Test specifies the type of simulation. test can be exact or appr,

exact refers to generation of data for an experiment that includes exact Steiner tree algorithm.

appr refers to generation of data for a experiment that involves only approximate Steiner tree algorithms.

If folder is NULL, it will use default value "steinerdata2" for folder when type is exact and "steinerdata" when type is appr.

listofterminaltest in our study was made of 5, 8, 20, 50, 70 for comparing approximate algorithms and it was 5, 8 for experiments that included exact Steiner tree algorithm. [1]

In our study, we repeated the tests 50 times, and we made the random walk to select a node to be terminal with 0.5 probability. Therefore repetition in our comparison was a list of fifty 0.5 values.

References

1. Afshin Sadeghi and Holger Froehlich, "Steiner tree methods for optimal sub-network identification: an empirical study", BMC Bioinformatics 2013 14:144

Examples

Run this code
# NOT RUN {
       library(igraph)
       library(SteinerNet)
       g <- igraph::graph.ring(10)
       
# }
# NOT RUN {
       
# }
# NOT RUN {
      generate_st_samples("exact", g, "testfolder", c(2,3), c(.8,.8))
       
# }

Run the code above in your browser using DataLab