<< NL_G: Graph NL_G: Graph NL_G_AddNodes >>

NARVAL >> NL_G: Graph > NL_G_AddEdges

NL_G_AddEdges

Add a list of new edges to a graph.

Calling Sequence

[Go] = NL_G_AddEdges(G,H,T,N)

Arguments

G :

Graph.

H :

Starting nodes of new edges (Head).

T :

Ending nodes of new edges (Tail).

N :

Names of new edges.

:

Output graph.

Description

NL_G_AddEdges adds the set of L new edges of names N defined by their starting nodes and ending nodes into the graph G. The output graph is stored in .

Examples

[g]=NL_G_MakeGraph('g1',4,[1 2 3 4],[2 3 4 1],[100 100 900 900],[100 900 900 100]);//generation of a graph
g.node_name=['n1' 'n2' 'n3' 'n4'];
g.edge_name=['e1' 'e2' 'e3' 'e4'];
nh=[1 2];//head vector of new edges
nt=[3 4];//tail vector of new edges
nn=['e5' 'e6'];//name vector of new edges
[go]=NL_G_AddEdges(g,nh,nt,nn);//application of NL_G_AddEdges
go.name='g2';
i1=1;
f=NL_G_ShowGraph(g,i1);
i2=2;
f2=NL_G_ShowGraph(go,i2);

Dependency

NL_G_Nodes2Edge, NL_G_MakeGraph, NL_G_GraphEdgesLength

Report an issue
<< NL_G: Graph NL_G: Graph NL_G_AddNodes >>