anSets: Find ancestral sets of a graph.

View source: R/Family.R

anSetsR Documentation

Find ancestral sets of a graph.

Description

Find ancestral sets of a graph.

Usage

anSets(graph, topOrder, sort = 1)

anSets2(graph, topOrder, maxbarren, same_dist = FALSE, sort = 1)

Arguments

graph

object of class mixedgraph, should be a summary graph

topOrder

optional topological order of vertices

sort

integer:1 for unique but unsorted, 2 for sorted.

maxbarren

maximum size of barren subsets

same_dist

logical, should barren vertices be in the same district?

Details

Algorithm:

  1. Find a topological order of nodes.

  2. Base case: is ancestral

  3. Induction: (i) Assume we have a list L of all ancestral sets involving Xi-1 in the order. (ii) If an ancestral set S in L contains all parents of Xi, Xi + S is also ancestral.

The function anSets2 proceeds by adding a new barren vertex to the set, which is not a descendant of any existing vertices. It consequently provides the option maxbarren to cap this at a fixed value.

Functions

  • anSets2(): Uses different algorithm

Author(s)

Ilya Shpitser


rje42/MixedGraphs documentation built on June 4, 2024, 9:47 a.m.