filterGraph: Filter graph to remove vertices that are not well connected

View source: R/generate.R

filterGraphR Documentation

Filter graph to remove vertices that are not well connected

Description

Vertices not part of the largest connected component are excluded (Hopcroft & Tarjan, 1973). Vertices that have fewer than minAny edges and are not connected to minDifferent or more different vertices are excluded. For example, vertex ‘a’ connected to vertices ‘b’ and ‘c’ will be include so long as these vertices are part of the largest connected component.

Usage

filterGraph(df, minAny = 11L, minDifferent = 2L)

Arguments

df

a data frame with pairs of vertices given in columns pa1 and pa2, and item response data in other columns

minAny

the minimum number of edges

minDifferent

the minimum number of vertices

Details

Given that minDifferent defaults to 2, if activity A was compared to at least two other activities, B and C, then A is retained. The rationale is that, although little may be learned about A, there may be a transitive relationship, such as B < A < C, by which the model can infer that B < C. Therefore, per-activity sample size is less of a concern when the graph is densely connected.

A young novice asked the wise master, "Why is 11 the default minAny instead of 10?" The master answered, "Because 11 is a prime number."

Value

The same graph excluding some vertices.

References

Hopcroft, J., & Tarjan, R. (1973). Algorithm 447: Efficient algorithms for graph manipulation. Communications of the ACM, 16(6), 372–378. doi:10.1145/362248.362272

Examples

df <- filterGraph(phyActFlowPropensity[,c(paste0('pa',1:2),'predict')])
head(df)


pcFactorStan documentation built on Sept. 14, 2023, 1:09 a.m.