transformGraphBy function

Apply a function to a graph considering non-diagonal structural zeros