Repository: networkx/networkx

Issue:
Triadic Census for Undirected Graph
Is there any specific reason (for e.g. computationally expensive, etc.) why the [triads algorithms](https://networkx.org/documentation/stable/reference/algorithms/triads.html) are not implemented for Undirected Graphs ? From what I understand, there would be only 4 types of triads possible in an undirected graph and the calculation would be similar to how it's done for directed graph. Please let me know if I am missing something here. Also, can I please go ahead with the implementation for the triad algorithms ?  :)


Discussion:
There is no specific reason not to do it for undirected graphs. Go for it. :}
@dschult  i would like to know can we modify the documentation of traids as the given documentation shows for directed graph but can also be used as undirected .
We need to ad  more than documentation changes to make this work for undirected graphs. The types of triads are not the same for directed and undirected. As the OP in this Issue mentions, there are 4 types of undirected triads possible. So the code would be similar to what we've got, but different. Another question is whether anyone is interested in undirected triads. I haven't seen any literature about it, but I haven't looked either. :)
There seems to be a way to develop a triadic census for undirected graphs (referred to very briefly in [these ucinet help pages](http://www.analytictech.com/ucinet/help/hs4335.htm).  It essentially says: convert the graph to directed using `G.to_directed()` and then run the existing algorithm. Only 4 triad types will show up in the census -- the ones that only consist of double-direction edges.

Given that the literature on this idea/concept is essentially non-existent, and what is there is a very simple approach to using the current function. I think the best approach to handling this issue is to put a one-line comment in the doc_string that creating a triadic census for an undirected is best done by converting the graph to a directed graph and then running the provided function. Maybe also mention that only the following triads will arise: 003, 102, 201 and 300.

This change should be easy to implement.
@dschult  i think this would work 
` Note: For undirected networks, create a triadic census by converting the graph to a directed graph using G.to_directed().
Only the triad types 003, 102, 201, and 300 will arise in the undirected case.`
Hello everyone,
I hope this message finds you well. I am interested in contributing to this issue and wanted to see if there is anyone working on it. If not, I would be happy to take care of it and send a pull request. Please let me know if there is someone already working.
Thank you!

go for it. :)

Resolving patch:
diff --git a/networkx/algorithms/triads.py b/networkx/algorithms/triads.py
--- a/networkx/algorithms/triads.py
+++ b/networkx/algorithms/triads.py
@@ -178,6 +178,11 @@ def triadic_census(G, nodelist=None):
     This algorithm has complexity $O(m)$ where $m$ is the number of edges in
     the graph.
 
+    For undirected graphs, the triadic census can be computed by first converting
+    the graph into a directed graph using the ``G.to_directed()`` method.
+    After this conversion, only the triad types 003, 102, 201 and 300 will be
+    present in the undirected scenario.
+
     Raises
     ------
     ValueError


Test patch: