I'm comparing graph traversal material between two books: CLRS's Introduction to Algorithms, 3rd Edition (known simply as CLRS), and RN's Artificial Intelligence: A Modern Approach, 3rd edition (known simply as AIMA).
In both the sections on Breadth First Search and Depth First Search I notice that CLRS keeps track of unvisited nodes, frontier nodes, and visited nodes by coloring them white, gray and black, respectively, meanwhile AIMA keeps track of unvisited, frontier, and visited nodes by keeping track of frontier and visited nodes with data structures external to the graph and its nodes.
It seems the method in AIMA of using data structures to keep track of frontier and visited nodes is more memory efficient and works better in the case that there may be infinite nodes in the graph. Is there a reason someone would prefer graph coloring instead, or what are the differences between the two?