To answer the second question:
Does greedy coloring give optimal coloring in all perfect graphs??
In general, no. An easy example of a perfect graph which is greedily coloured in the order of alphabetical order of the vertices [a,b,c,d] with edges {ac, bc, db} will produce a 3-colouring of a 2-colourable graph. If you want to impose that greedily colouring should process the vertices in a BFS manner, then the same graph with a source vertex s
adjacent to each of a,b,c,d, and beginning at s
will similarly produce a 4-colouring of a 3-colourable graph.
There is a subset of perfect graphs called perfectly orderable graphs which can have its vertices ordered in such a way that greedily-colouring these vertices in that order, it is guaranteed to produce an optimal colouring - not only for the graph itself - but that same ordering gives an optimal greedy colouring for every induced subgraph.
One of the problems with this is that even when given a perfectly orderable graph, it is still NP-hard to find such a perfect order.
On the other hand, there are several subclasses of perfectly orderable graphs for which is it easy to find a perfect order (and thus greedy colouring is guaranteed optimal). In particular, the class of cographs has the property that any vertex ordering is a perfect order (meaning any greedy colouring of a cograph is guaranteed to be optimal).