#################################################################
##  CS 3600 (Winter 2025), Assignment #3                       ##
##  Program File Name: myNRCFunctions.py                       ##
##       Student Name: Todd Wareham                            ##
##         Login Name: harold                                  ##
##              MUN #: 8008765                                 ##
#################################################################

## Matrix printing and network robustness functions for Assigment #3.
##
##      *** ONLY ADD REQUESTED CODE ***
## 
##   DO NOT:
##      * MODIFY THE TWO SPECIFIED IMPORT STATEMENTS
##      * ADD OTHER IMPORT STATEMENTS
##      * ADD OR REMOVE FUNCTION DEFINITIONS
##      * ADD NEW CLASS DEFINITIONS OR GLOBAL VARIABLES (USE THE
##         PROVIDED CLASSES IN FILE MYCSTMSCCCLASSES.PY)
##      * ACCESS ANY PROVIDED CLASS ATRIBUTES DIRECTLY (USE
##         PROVIDED ATTRIBUTE ACCESS FUNCTIONS IN THE FILE 
##         MYCSTMSCCLASSES.PY)
##         
##

import math
import copy
from myNRCClasses import *


## Function prints integer matrix M.

def printIntMatrix(M):
   numVertices = len(M)
   print("     ", end="")
   for j in range(1,numVertices):
      print("{0:6d}".format(j+1), end="")
   print("\n")
   for i in range(numVertices - 1):
      print(" {0:2d}: ".format(i+1), end="")
      for j in range(1,numVertices):
         if (j <= i):
            print("      ", end="")
         else:
            if ((M[i][j] == math.inf) or (M[i][j] == 0)):
               print("  ----", end="")
            else:
               print("{0:6d}".format(M[i][j]), end="")
      print()
          

## Function prints floating-point matrix M.

def printFltMatrix(M):
   numVertices = len(M)
   print("     ", end="")
   for j in range(1,numVertices):
      print("{0:6d}".format(j+1), end="")
   print("\n")
   for i in range(numVertices - 1):
      print(" {0:2d}: ".format(i+1), end="")
      for j in range(1,numVertices):
         if (j <= i):
            print("      ", end="")
         else:
            if ((M[i][j] == 1.0 * math.inf) or (M[i][j] == 0.0)):
               print("  ----", end="")
            else:
               print("  {0:4.1f}".format(M[i][j]), end="")
      print()
          

## Given an undirected graph G, function computes and returns the
##  floating-point network robustness matrix for G according to
##  the definition of network robustness given in the main text of
##  Assignment #3.

def getRobustness(G):
##   *** ADD REQUESTED CODE ***


## Given a graph edge-weight matrix W, function computes and returns the
##  the all-pairs shortest paths matrix for W.

def APSP(W):
##   *** ADD REQUESTED CODE ***

