How can I define the input for this function?

In the below function it is explained how to set the input:
function nMM=grMaxMatch(E)
% Function nMM=grMaxMath(E) solve the maximal matching problem.
% Input parameter:
% E(m,2) or (m,3) - the edges of graph and their weight;
% 1st and 2nd elements of each row is numbers of vertexes;
% 3rd elements of each row is weight of edge;
% m - number of edges.
% If we set the array E(m,2), then all weights is 1.
However, I can not understand how to define E. For example, for a graph with edges like [(1,2),(2,3)] how should I set up E?

댓글 수: 4

For [(v1,v2),(v3,v4)]:
E(1,1) = v1;
E(1,2) = v2;
E(2,1) = v3;
E(2,2) = v4;
Complete function is here
So for my example
E=[1 2;
2 3];
But this does not work with as an input for that function!
Torsten
Torsten 2018년 8월 23일
Then you should contact the author of the code. He/She knows best how to cope with possible problems.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

태그

질문:

2018년 8월 22일

댓글:

2018년 8월 23일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by