Code covered by the BSD License
-
BG=grBase(E)
Function BG=grBase(E) find all bases of digraph.
-
CBG=grCoBase(E)
Function CBG=grCoBase(E) find all contrabases of digraph.
-
CoCycles=grCoCycleBasis(E)
Function CoCycles=grCoCycleBasis(E) find
-
Cycles=grCycleBasis(E)
Function Cycles=grCycleBasis(E) find
-
Etc=grTranClos(E)
Function Etc=grTranClos(E) built
-
[CrP,Ts,Td]=grPERT(E)
-
[Dec,Ord]=grDecOrd(E)
Function Dec=grDecOrd(E) solve
-
[Ec,Rad,Diam,Cv,Pv]=grEccentr...
Function Ec=grEccentricity(E) find the (weighted)
-
[IsIsomorph,Permut]=grIsomorp...
Function [IsIsomorph,Permut]=grIsomorph(E1,E2,n)
-
[dMWP,ssp]=grShortVerPath(E,W...
Function dMVP=grShortVerPath(E,Wv) for digraph with weighted vertexes
-
[dSP,sp]=grDistances(E,s,t)
Function dSP=grDistances(E) find the distances
-
[dSP,sp]=grShortPath(E,s,t)
Function dSP=grShortPath(E) solve the problem about
-
[eu,cEu]=grIsEulerian(E)
Function eu=grIsEulerian(E) returns 1 for Eulerian graph,
-
[nMCS,mf]=grMinCutSet(E,s,t)
-
[pTS,fmin]=grTravSale(C)
Function [pTS,fmin]=grTravSale(C) solve the nonsymmetrical
-
[v,mf]=grMaxFlows(E,s,t)
-
grValidation(E);
The validation of array E - auxiliary function for GrTheory Toolbox.
-
h=grPlot(V,E,kind,vkind,ekind...
Function h=grPlot(V,E,kind,vkind,ekind,sa)
-
mCol=grColEdge(E)
function mCol=grColEdge(E) solve the color graph problem
-
nCol=grColVer(E)
function nCol=grColVer(E) solve the color graph problem
-
nCol=grColVerOld(E)
function nCol=grColVer(E) solve the color graph problem
-
nMC=grMinEdgeCover(E)
Function nMC=grMinEdgeCover(E) solve the minimal edge cover problem.
-
nMC=grMinVerCover(E,d)
Function nMC=grMinVerCover(E,d) solve the minimal vertex cover problem.
-
nMM=grMaxMatch(E)
Function nMM=grMaxMath(E) solve the maximal matching problem.
-
nMS=grMaxComSu(E,d)
Function nMS=grMaxComSu(E,d) solve
-
nMS=grMaxStabSet(E,d)
Function nMS=grMaxStabSet(E,d) solve the maximal stable set problem.
-
nMS=grMinAbsEdgeSet(E)
Function nMS=grMinAbsEdgeSet(E) solve the minimal absorbant set problem
-
nMS=grMinAbsVerSet(E,d)
Function nMS=grMinAbsVerSet(E,d) solve the minimal absorbant set problem
-
nMST=grMinSpanTree(E)
Function nMST=grMinSpanTree(E) solve
-
ncV=grComp(E,n)
Function ncV=grComp(E,n) find all components of the graph.
-
Contents.m
-
grTheoryTest.m
-
View all files
from
grTheory - Graph Theory Toolbox
by Sergii Iglin
28 functions for different tasks of graph theory
|
| mCol=grColEdge(E)
|
function mCol=grColEdge(E)
% function mCol=grColEdge(E) solve the color graph problem
% for edges of the graph.
% Input parameter:
% E(m,2) - the edges of graph;
% 1st and 2nd elements of each row is numbers of vertexes;
% m - number of edges.
% Output parameter:
% mCol(m,1) - the list of the colors of edges.
% Uses the sequential deleting of the maximal matching sets.
% Required the Optimization Toolbox v.3.0.1 or over.
% Author: Sergii Iglin
% e-mail: siglin@yandex.ru
% personal page: http://iglin.exponenta.ru
% ============= Input data validation ==================
if nargin<1,
error('There are no input data!')
end
[m,n,E] = grValidation(E); % E data validation
E=[E(:,1:2),[1:m]']; % numbers of vertexes and numbers of edges
mCol=zeros(m,1); % initial value
% ============= Main cycle with MaxMatch deleting ====
while any(mCol==0),
ne=find(mCol==0); % uncolored edges
E1=E(ne,:); % it's edges
nMM=grMaxMatch(E1(:,1:2)); % the maximal matching
mCol(E1(nMM,3))=max(mCol)+1; % the next colorend
end
return
|
|
Contact us at files@mathworks.com