Arcs

<< Click to Display Table of Contents >>

Navigation:  Using SMILE Wrappers > Networks, nodes and arcs >

Arcs

The graph defined by nodes and arcs in a Network instance is always a directed acyclic graph (DAG). Any attempt to add an arc that would introduce a cycle will result in an exception.

The following methods of the Network class are used to add or delete arcs between nodes:

Python

add_arc(parent: int | str, child: int | str) -> None

delete_arc(parent: int | str, child: int | str) -> None

Java

void addArc(int parentHandle, int childHandle);

void addArc(String parentId, String childId);

void deleteArc(int parentHandle, int childHandle);

void deleteArc(String parentId, String childId);

C#

void AddArc(int parentHandle, int childHandle);

void AddArc(string parentId, string childId);

void DeleteArc(int parentHandle, int childHandle);

void DeleteArc(string parentId, string childId);

R

addArc(parentIdOrHandle, childIdOrHandle)

deleteArc(parentIdOrHandle, childIdOrHandle)
 

To inspect the network structure, use the following methods. Methods ending with Ids return arrays of string identifiers for the related nodes, while methods without the suffix return arrays of integer node handles..

Python

get_parents(node: int | str) -> List[int]

get_parent_ids(node: int | str) -> List[str]

get_children(node: int | str) -> List[int]

get_child_ids(node: int | str) -> List[str]

Java

int[] getParents(int nodeHandle);

int[] getParents(String nodeId);

String[] getParentIds(int nodeHandle);

String[] getParentIds(String nodeId);

int[] getChildren(int nodeHandle);

int[] getChildren(String nodeId);

String[] getChildIds(int nodeHandle);

String[] getChildIds(String nodeId);

C#

int[] GetParents(int nodeHandle);

int[] GetParents(string nodeId);

string[] GetParentIds(int nodeHandle);

string[] GetParentIds(string nodeId);

int[] GetChildren(int nodeHandle);

int[] GetChildren(string nodeId);

string[] GetChildIds(int nodeHandle);

string[] GetChildIds(string nodeId);

R

parentHandles <- getParents(nodeIdOrHandle)

parentIds <- getParentIds(nodeIdOrHandle)

childHandles <- getChildren(nodeIdOrHandle)

childIds <- getChildIds(nodeIdOrHandle)