Search All of the Math Forum:

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

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

Topic: getedgesbynodeid and graphshortestpath problem
Replies: 0

 Poornima Posts: 2 Registered: 7/22/13
getedgesbynodeid and graphshortestpath problem
Posted: Jul 25, 2013 11:12 AM

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...

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])
set(edges,'LineWidth',1.5)

Poornima