When the comaximal and zero-divisor graphs are ring graphs and outerplanar