Class Mam_bgchain_groups
Solver_mam_bgchain applies to the chains it is not
carrying exactly.
WHY DEMAND IS THE RIGHT CRITERION. The aggregate that replaces a group carries the flow-weighted mean of its members' service times and routing, so the group aggregates EXACTLY when its members place the same demand at every station, and distorts both quantities in proportion to how far apart they are. The distance is therefore the symmetric relative L1 gap between the demand vectors,
dist(a,b) = sum_i |D[i][a] - D[i][b]| / ((sum_i D[i][a] + sum_i D[i][b])/2),
which is scale-relative rather than absolute: it separates two chains whose demand PROFILE across the stations differs and two chains whose profile agrees but whose magnitude does not, and being dimensionless it groups a model the same way whatever its time unit.
WHY COMPLETE LINKAGE. The clustering is agglomerative from singletons, merging at each step the pair of clusters whose WORST member-to-member distance is smallest. The aggregation error inside a group is driven by its worst mismatch and not by its average one, so complete linkage is the criterion that bounds what the aggregation actually costs; average or single linkage would let one distant chain ride along inside an otherwise tight group.
DETERMINISM. Ties are broken by the lexicographically smallest pair of cluster indices and the groups are relabelled by their smallest member, so the same input gives the same grouping in MATLAB, the JAR, Python and C++.
- See Also:
-
Method Summary
-
Method Details
-
mam_bgchain_groups
public static int[] mam_bgchain_groups(double[][] D, int G) - Parameters:
D- (Mc x n) per-station demand, one column per chainG- number of groups wanted, clamped to [1, n]- Returns:
- group index in 0..G-1 of each chain
-