I'll consider a graph (quiver) $E=(E^0,E^1,s,r)$, where $E^0$ is the set of vertices, $E^1$ is the set of arrows, and $s,r\colon E^1\to E^0$ are the source and range maps. I allow loops and multiple edges between two vertices.
Basically, I want to count "how many cycles make up the graph $E$". I am not sure how to define this invariant properly, or even if it is well-defined. So assuming it is a sensible graph property, it should define an invariant which depends only on the graph.
Question: Is it possible to define "the number of cycles which make up a graph in a formal way?
I'll list a few examples of graphs which are "made up" of two cycles, intuitively
So for example, the following graph is "made up" of two cycles: $e$ and $f$
There is also another simple cycle (which does not repeat edges) in this graph: the path $ef$.
Now consider the following graph:
It is also "made up" of two simple cycles: the "left-right ones" $cdef$ and $abg$.
But we can also decompose it in more interesting ways: for example the "in-out cycles" $abcde$ and $fg$.
Let's modify the graph above a little:
It also seems to be made up of two cycles, but it is a little harder to do in this case: the simplest way I can see how to do it is as $baf$ and $gfcdef$. The latter cycle is not simple anymore, and in fact I am pretty sure the graph cannot be decomposed into disjoint simple cycles. But still, the invariant of this graph should be $2$.



It seems to me that you want to define the minimal number of cycles required, such that deleting their edges gives a cyclefree graph. As a minimum this should be well defined and I think it satisfies your conditions. Moreover edges, which are not part of a cycle, will not contribute to this invariant.
I think of a cycle to repeat neither vertices nor edges (besides start and endpoint), so in your first example $ef$ should not count as a cycle, at least in my opinion.