LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
getReducibilityInfo.m
1function info = getReducibilityInfo(self)
2% INFO = GETREDUCIBILITYINFO()
3%
4% Returns detailed information about the reducibility structure of the
5% network's routing matrix.
6%
7% Output:
8% INFO: struct with the following fields:
9% - isRoutingErgodic: true if the routing is ergodic (irreducible)
10% - isReducible: true if the routing is reducible
11% - absorbingStations: cell array of names of absorbing stations
12% - transientStations: cell array of names of transient stations
13% - numSCCs: number of strongly connected components
14% - suggestedFixes: cell array of suggested routing fixes
15%
16% Copyright (c) 2012-2026, Imperial College London
17% All rights reserved.
18
19[isErg, info] = self.isRoutingErgodic();
20info.isRoutingErgodic = isErg;
21info.suggestedFixes = {};
22
23if ~isErg
24 % Generate suggested fixes for absorbing stations
25 nodeNames = self.getNodeNames();
26 stationIdxs = self.getStationIndexes();
27
28 % Find a suitable return target (first Delay node, or first station)
29 returnTarget = '';
30 for idx = stationIdxs
31 node = self.nodes{idx};
32 if isa(node, 'Delay')
33 returnTarget = nodeNames{idx};
34 break;
35 end
36 end
37 if isempty(returnTarget) && ~isempty(stationIdxs)
38 returnTarget = nodeNames{stationIdxs(1)};
39 end
40
41 % Generate fix suggestions for each absorbing station
42 for i = 1:length(info.absorbingStations)
43 absStation = info.absorbingStations{i};
44 if ~isempty(returnTarget) && ~strcmp(absStation, returnTarget)
45 info.suggestedFixes{end+1} = sprintf(...
46 'Route jobs from %s back to %s (e.g., P{class}(%s, %s) = 1.0)', ...
47 absStation, returnTarget, absStation, returnTarget);
48 end
49 end
50end
51
52end