Right way of getting degrees of vertices Suppose I have the following list of nodes:

*

*A E G

*A E H

*A F G

*A F H

*B E G

*B E H

*B F G

*B F H

*C F

*C E

*D G

*D H

Every line indicates the connections between those nodes. So there is a connection between A and E, E and G, A and G.
This is how the graph looks like:

I now want to compute the degrees of all nodes.
There are several option:

*

*Count the occurrences in the list

*A, B, C, D: 4

*E, F, G, H: 5

*C, D: 2

*Count all combinations

*A-E, A-G, A-E, A-H, A-F, A-G, A-F, A-H --> A: 8
What is the right approach?
Also, I want the relative degrees of them, so a number in the interval of 0 an 1.
So I assume, that would be $$\frac{\mathrm{degree}}{\mathrm{total\:\#\:of\:degrees}} \implies A= \frac{4}{32}=0.125$$
 A: There is very easy way: for $N$ vertices, create adjacency matrix $N \times N$ filled with $0$'s and then for each clique set corresponding elements to 1. For each vertex, degree will  be sum of rows (or columns). For your example, with vertices ordered $A,B,C,D,E,F,G,H$ adjacency matrix will be:
$$\pmatrix{
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 1 & 1 \\
0 & 0 & 0 & 0 & 1 & 1 & 0 & 0 \\
0 & 0 & 0 & 0 & 0 & 0 & 1 & 1 \\
1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 \\
1 & 1 & 1 & 0 & 0 & 0 & 1 & 1 \\
1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 \\
1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 }$$
This approach requires $O(N^2)$ memory and up to $O(N^4)$ operations in worst cases.
Slightly smarter approach: for each vertex $V$, go through clique list; for every clique containing $V$ add to the set of connected vertices all other vertices of the clique. Count elements in the set. $O(N)$ memory, $O(N^4)$ time. Essentially this is computing adjacency matrix one row at a time.
For big graphs we may try this:


*

*Divide vertices in two sets (simple way: first $N/2$ and second $N/2$).

*Find the biggest clique $C$ ("pivot clique") of size $N_c$ containing vertices from both sets (if no such clique exists, divide the list into two and repeat algorithm from step 1 for each new list separately).

*Divide other cliques into containing vertices from $C$ ("reduce list") and not ("remainder list").

*Add $N_c-1$ to degrees of all vertices from $C$.

*For each clique in the reduce list, for each vertex of $C$ containing in that clique add non-$C$ vertices of the clique to sets corresponding to $C$-vertices.

*For each vertex of $C$ add size of corresponding set to its degree and 1 to degree of all vertices in that set.

*For each clique of the reduce list, remove $C$ vertices from it and add what's left to the remainder list (if only one vertex remains or we found that there is a clique in remainder list which includes ours, remove it instead).

*Repeat from 2. with remainder list (unless it's empty).


Taking your graph as an example:


*

*Sets are $(A,C,E,F), (B,D,G,H)$. Initial degrees are $(A:0,B:0,C:0,D:0,E:0,F:0,G:0,H:0)$.


2a. Pivot clique is $(A,E,G)$.


*Reduce list: $(A,F,G)$, $(A,E,H)$, $(A,F,H)$, $(B,E,G)$, $(B,E,H)$, $(B,F,G)$, $(C,E)$, $(D,G)$. Remainder list: $(B,F,H)$, $(C,F)$, $(D,H)$.

*Degrees are $(A:2,B:0,C:0,D:0,E:2,F:0,G:2,H:0)$.

*Sets are $A: \{F,H\}$, $E: \{B,C,H\}$, $G: \{B,D,F\}$.

*Degrees are $(A:4,B:2,C:1,D:1,E:5,F:2,G:5,H:2)$.

*Remainder list: $(B,F,H)$, $(C,F)$, $(D,H)$, $(F,H)$(removed), $(B,H)$(removed), $(B,F)$(removed).


2b. Pivot clique is $(B,F,H)$.


*Reduce list: $(C,F),(D,H)$. Remainder list: (empty).

*Degrees are $(A:4,B:4,C:1,D:1,E:5,F:4,G:5,H:4)$.

*Sets are $B: \{\}$, $F: \{C\}$, $H: \{D\}$.

*Degrees are $(A:4,B:4,C:2,D:2,E:5,F:5,G:5,H:5)$.

*Remainder list: (empty).


Result - degrees are $(A:4,B:4,C:2,D:2,E:5,F:5,G:5,H:5)$. This algorithm requires $O(N^3)$ memory and possibly up to $O(N^5)$ time in worst case, but can be potentially very effective if it manages to "cut" the graph in half quickly enough.
A: Your question is a little confusing. As one of the commenters points out, it looks a lot like you have a list of cliques - that is, sets of nodes all connected to each other within the set.
The degree of a node is just the number of neighbours it has (or edges connected to it) and your graph seems to have {5: [E, F, G, H], 4: [A, B], 2: [C, D] } based on the diagram. I've re-drawn it a bit more symmetrically :

looks a bit nicer, I think.
Finally, I'm not sure what you mean by 'relative degree' - do you mean the sum of the degrees of the nodes in the clique divided by the number of nodes in the clique?
