computeOSPFRoutes<T> function

OSPFRoutingTable<T> computeOSPFRoutes<T>(
  1. Map<T, Map<T, num>> network,
  2. T sourceRouter, {
  3. int areaId = 0,
})

Convenience function for quick OSPF route computation

network - Network topology as adjacency list sourceRouter - Source router for routing table areaId - OSPF area ID (default: 0 for backbone)

Returns complete OSPF routing table from source router

Throws ArgumentError if source router doesn't exist in network

Implementation

OSPFRoutingTable<T> computeOSPFRoutes<T>(
  Map<T, Map<T, num>> network,
  T sourceRouter, {
  int areaId = 0,
}) {
  return OSPFAlgorithm<T>().computeRoutes(
    network,
    sourceRouter,
    areaId: areaId,
  );
}