Skip to content

Implement "copy" functionality for FGraph #52

Description

@DoganCK

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

Activity

  1. added this to the Graphoscope Hackathon milestone on Sep 25, 2023
  2. timu commented on Sep 30, 2023

    @timu
    Contributor

    I'll be working on this one

  3. timu commented on Sep 30, 2023

    @timu
    Contributor

    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:

    1. Enforce IClonable, so that the user has to use data types that implement _.Clone(), or implement _.Clone() for their own data types.
    2. Constraint these generics to be value types. This means that records should have [<Struct>] flag.
    3. Do nothing, just tell the user is cloning might not work if the generics are reference types.

    Implementation of these options is relatively trivial and can be applied as soon as a decision has been reached.

  4. added a commit that references this issue on Sep 30, 2023
  5. added a commit that references this issue on Sep 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions