centrality_factor {CurricularAnalytics} | R Documentation |
Calculate centrality
Description
A helper function for calculating the centrality for each node.
Usage
centrality_factor(node_list, edge_list)
Arguments
node_list |
Dataframe with an 'id' column for each node and a 'term' column specifying which term the course is to be taken in. |
edge_list |
Dataframe with two columns 'from' and 'to' specifying
directed edges starting at 'from' nodes directed towards 'to' nodes. Entries
must use node ids from |
Details
A course is considered central if it has many requisite edges flowing in and
out of the node. More formally it is the number of long paths that include the
node. That is, consider a curriculum graph and a vertex
. A
long path is a path that satisfies the following conditions:
-
are distinct
-
-
is a source node (in-degree zero)
-
is a sink node (out-degree zero)
Let denote the set of all paths defined as
above. Then the centrality of a node
is given by
More plainly this is the number of paths containing of at least length 3 where
is neither a source nor sink node.
Value
A dataframe containing the centrality of each node
Author(s)
Daniel Krasnov
References
Heileman, Gregory L, Chaouki T Abdallah, Ahmad Slim, and Michael Hickman. 2018. “Curricular Analytics: A Framework for Quantifying the Impact of Curricular Reforms and Pedagogical Innovations.” arXiv Preprint arXiv:1811.09676.
Examples
edge_list <- data.frame(from = c(1, 3), to = c(3, 4))
node_list <-
data.frame(
id = 1:4,
label = c("MATH 100", "DATA 101", "MATH 101", "MATH 221"),
term = c(1, 1, 2, 2)
)
cf_df <- centrality_factor(node_list,edge_list)
print(cf_df)
# Output:
# id cf
#1 1 0
#2 2 0
#3 3 3
#4 4 0