Find all sets of nodes that can be connected with a single path **  Edit: I just noticed my current algorithm is incorrect, as it only finds paths starting/ending at the given node. I'm trying to figure out a solution, but I'm a bit stuck.

Say I have an undirected graph. I would like to find all possible combinations of nodes that could be connected with a single path, that include a certain node.

--clarification: That is paths starting and ending at any node. Not just paths starting at the node in question.

Take this graph for example:

A----B
|    |
|    |
D----C


The solution for node A would be:

ABCD; example path A-&gt;B-&gt;C-&gt;D. Alternatively B-&gt;A-&gt;C-&gt;D or many others. As long as we have one, we're good.
ABC; example path C-&gt;B-&gt;A, etc.
ADC
AB
AD
A; 'path' from itself to itself


I understand this is a -very- hard problem with a lot of results. To make it simpler it is allowed to have some duplicates in the end result, but less would be better(this makes cyclic graphs a bit easier).

My current(naive) solution is as follows:


Start at the node in question
Note current path as possible path.
If no possible connections, return.
For each possible connection, go into recursion via [2].


See the following example. The problem with my algorithm is that a lot of duplicates are generated. Here the bottom two items in the example tree are the same solution.
Just use depth-first search. Each node you encounter in the search tree corresponds to a path from the source vertex.