<< NL_G_GraphStructure NL_G: Graph NL_G_HighlightEdges >>

NARVAL >> NL_G: Graph > NL_G_GraphUnion

NL_G_GraphUnion

Merge two graphs in respect with a defined edge between two nodes.

Calling Sequence

[G] = NL_G_GraphUnion(N1,G1,N2,G2)

Arguments

:

Node index.

:

First graph.

:

Node index.

:

Second graph.

G :

Output graph.

Description

NL_G_GraphUnion merges the two graphs and into a single entity G. To achieve this fusion, a new edge is created between the node of the graph and the node of the graph .

The graph is now connected to the graph in respect with the new edge between the nodes and .

Examples

[g1]=NL_G_MakeGraph('g1',4,[1 2 3 4],[2 3 4 1],[100 100 200 200],[100 200 200 100]);//generation of the first graph
[g2]=NL_G_MakeGraph('g2',3,[1 2 3],[2 3 1], [300 350 400],[300 400 300]);//generation of the second graph
n1=3;//node index in g1
n2=1;//node index in g2
[g]=NL_G_GraphUnion(n1,g1,n2,g2);//application of NL_G_GraphUnion
ind=1;//window index
f=NL_G_ShowGraph(g,ind);//graph visualization

Dependency

NL_G_EdgeDataFields, NL_G_NodeDataFields, NL_G_MakeGraph, NARVAL_G_GraphEdgesLength

Report an issue
<< NL_G_GraphStructure NL_G: Graph NL_G_HighlightEdges >>