I don't think you need to do anything special for them. Your algorithm for counting subgraphs shouldn't go in an infinite loop when fed a cycle, but assuming you have such an algorithm already, getting the vector representation should be straightforward.