Session graph function