A Linear Algebraic Method on the Chromatic Symmetric Function