calculate.PFN: PFN calculation

Description Usage Arguments Details Value Author(s) Examples

Description

main function to calculate PFN a ranked list of edge pairs

Usage

1
2
calculate.PFN(edgelist,max.skipEdges = NULL,maxENum = NULL,doPar = FALSE,
num.cores = NULL,keep.track = TRUE)

Arguments

edgelist

three column edgelist: first two columns are topological edges, and the third column is the weight. Must be a data.frame object.

max.skipEdges

Maximum number of edges to be searched by planarity test without any inclusion to PFN. If set NULL, it will be automatically set to number of cores x 1000. It acts as a threhold to quicken PFN construction termination during PCP.

maxENum

maximum number of edges to include in final PFN. Default value is NULL, which invokes maximal number of edges allowed in planar network.

doPar

TRUE/FALSE logical variable to choose parallelization.

num.cores

number of cores to use in parallelization.

keep.track

If TRUE, pfg_el.RData will be created in working folder. This file can be used later for restart in case PFN construction did not finish successfully. Default is TRUE.

Details

If doPar = TRUE, then num.cores are registered for PCP.

Value

output is three column edgelist data.frame, third column being the weight.

Author(s)

Won-Min Song

Examples

1
2
3
4
# test simplest case of planar network (a 3-clique).
a <- c(1,1,2);b <- c(2,3,3);w <- runif(3,0,1);
el <- cbind(a,b,w);el <- as.data.frame(el[order(el[,3],decreasing = TRUE),])
calculate.PFN(edgelist = el,max.skipEdges = Inf,doPar = FALSE,num.cores = NULL)

Example output

Loading required package: doParallel
Loading required package: foreach
Loading required package: iterators
Loading required package: parallel
Loading required package: igraph

Attaching package: 'igraph'

The following objects are masked from 'package:stats':

    decompose, spectrum

The following object is masked from 'package:base':

    union

####### PFN Calculation commences ########
[1] "PFG is complete."
  row col    weight
1   1   3 0.8791673
2   1   2 0.4047293
3   2   3 0.2975602

MEGENA documentation built on May 1, 2019, 8:07 p.m.