The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: getedgesbynodeid and graphshortestpath problem
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 2
Registered: 7/22/13
getedgesbynodeid and graphshortestpath problem
Posted: Jul 25, 2013 11:12 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi all,
I am getting this error....
??? Error using ==> biograph.biograph.getedgesbynodeid at 62
When two input arguments are given, NODE_IDS (or PATH_IDS) must be a cell string.edges = getedgesbynodeid(h,get(h.Nodes(path),'ID'));

What am I supposed to do to get over this error, I am trying to color the shortest path.
The DIST, PATH visible in graphkshortestpaths function is not visible with graphshortestpath...

Please I need help.

The code snippet is ....
[DIST,PATH]= graphkshortestpaths( G, stnode, destnode, 2 );
h = view(biograph(G,[],'ShowArrows','Off','ShowWeights','off'));

%stnode is start node , destnode is the end node
[dist, path, pred] = graphshortestpath(G,stnode,destnode);
set(h.Nodes(path),'Color',[1 0.4 0.4]);
% fowEdges = getedgesbynodeid(h,get(h.Nodes(path),'ID'));
% revEdges = getedgesbynodeid(h,get(h.Nodes(fliplr(path)),'ID'));
% edges = [fowEdges;revEdges];
edges = getedgesbynodeid(h,get(h.Nodes(path),'ID'));
set(edges,'LineColor',[1 0 0])

Thank you once again, please help.

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.