Open DoganCK opened 1 year ago
I'll be working on this one
The implementation is a shared effort from myself and @yigitl.
We now have an implementation that creates clones of undirected graphs.
Currently, the function will create a deep copy if the NodeData/EdgeData generics are value types, and it will create a shallow copy if these are reference types.
This implementation should be revised after a decision on how to handle EdgeData/NodeData generics. There are three ways of handling these generics:
IClonable
, so that the user has to use data types that implement _.Clone()
, or implement _.Clone()
for their own data types.[<Struct>]
flag.Implementation of these options is relatively trivial and can be applied as soon as a decision has been reached.
Description Our ultimate goal is to leave the decision to use mutation or not to the user. Mutation makes sense for heavy duty operations that run on the cloud. But while developing and working with smaller graphs mutation gets in the way and can be unwieldy to use. The initial step for this is to have a deep copy functionality.
Pointers https://learn.microsoft.com/en-us/dotnet/api/system.object.memberwiseclone?view=net-7.0