How to deselect a node?

How to deselect a node by code?
Can you give me an example?
Actually On subGraphExpandedChanged function on grounp expand I need to deselect all selected nodes.