removeHubNode <- function(N=10, m=1, adjM, numLinks)
{
	# choose the highest degree node and remove it:
	p <- c(1:N)[numLinks[c(1:N)]==max(numLinks)] 
	
	# in case highest degree is degenerate:
	p <- sample(p, size=1)  

	# readjust the numLinks vector to reflect node removal:
	numLinks[p] <- 0
		
	# readjust the adjM to reflect node removal:
	for(i in 1:N)
		{
			adjM[i,p] <- 0
			adjM[p,p] <- 1
		}
	
	# outputting new graph to file, coloring high degree vertices red.
    zz <- file("exPA-RmvNode.dot","w")
    cat("graph G {","node [shape=circle,color=orange,style=filled,label=\"\",width=0.15,height=0.15]",file=zz,sep="\n")
    for(i in c(2:N)[c(2:N) != p])
    	for(j in 1:(i-1))
    	{
    		if(adjM[i,j] != 0)
    		{
    			if(numLinks[i] > N/10)
    			{
    				cat("node [color=red] ", file=zz)
        			cat(i,"--", j,"node [color=red] ;",file=zz)
        			cat("\n",file=zz)
        		}
        		else
        		{
        			cat(i,"--",j,"node [color=blue] ;",file=zz)
        			cat("\n",file=zz)
        		}
        	}
    	}
    cat("}","\n",file=zz)
    close(zz)
		
	return(invisible(list(adjM=adjM, numLinks=numLinks)))	
}