BEGIN {node_t n; int deg[]; int maxdeg;
maxdeg =1;}
E{
//$.label = $.weight;
deg[tail] = deg[tail] + $.weight; 
 if(maxdeg < deg[tail])
 {
 	maxdeg = deg[tail];
 }
}
END_G  { 
	string col;
	int rval;
	int scale;
  for (n = fstnode($G); n; n = nxtnode(n)) {
    if (n.shape != "box")
    {
        scale = ((128 / (float)log(maxdeg)) * log(deg[n]));
        col = sprintf("#%02X%02X%02X", scale, 255-scale, scale);
        //n.fillcolor = col;
        n.color = col;
        n.style = "filled";
        n.label = n.name + sprintf(" (%d)", deg[n]);
    }
  }
  $O = $G;
}
