Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Graph manipulation

5.0
5.0 | 3 ratings Rate this file 4 Downloads (last 30 days) File Size: 2.89 KB File ID: #37475 Version: 1.0

Graph manipulation

by

 

These four files are intended for adding/deleting nodes and edges in biograph object

| Watch this File

File Information
Description

Biograph class does not allow adding of deleting nodes or edges.
Here is the way how to overcome this. Graph_man.zip contains four M-files:

node_add.m - add node to existing graph
node_del.m - delete node from existing graph
edge_add.m - add edge to existing graph
edge_del.m - delete edge from existing graph

Required Products Bioinformatics Toolbox
MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (4)
03 May 2016 Pranava Gopu  
16 Dec 2015 Corey

Corey (view profile)

(update to previous comment, I think you may want to add 'bg.IsLaidout = 0;' to the end of node_add())

Comment only
16 Dec 2015 Corey

Corey (view profile)

Thanks for this submission, incredibly useful.

Currently testing in MATLAB Version 8.5.0.197613 (R2015a), win x64.

Note: In edge_add() I had to 'dolayout(bg);' to the end of the script. (Viewing caused error in edge::hgUpdate(), ControlPoints not set).

08 Nov 2013 Sven

Sven (view profile)

Excellent submission. I was surprised that there's nothing already in biograph to manipulate an already-computed graph. I'm making a few small additions such as the ability to remove a set of nodes by sticking this loop at the top of node_del()

if isnumeric(NodeID) && numel(NodeID)>1
for i = 1:length(NodeID)
thisNID = NodeID(i);
bg = node_del(bg,thisNID);
NodeID(NodeID>thisNID) = NodeID(NodeID>thisNID)-1;
end
return;
end

Contact us