package graph // Config holds configuration for graph operations type Config struct { // Query limits MaxChainLength int `json:"max_chain_length"` // Maximum length for resource chains MaxPathHops int `json:"max_path_hops"` // Maximum hops for path finding MaxNetworkSize int `json:"max_network_size"` // Maximum organizations in a network MinNetworkSize int `json:"min_network_size"` // Minimum organizations in a network DefaultResultLimit int `json:"default_result_limit"` // Default limit for query results // Distance constraints MaxChainDistanceKm float64 `json:"max_chain_distance_km"` // Maximum total distance for chains MaxPathDistanceKm float64 `json:"max_path_distance_km"` // Maximum distance for paths // Economic thresholds MinChainValue float64 `json:"min_chain_value"` // Minimum economic value for chains MinNetworkValue float64 `json:"min_network_value"` // Minimum value for networks // Performance settings QueryTimeoutSeconds int `json:"query_timeout_seconds"` // Query timeout in seconds EnableGDS bool `json:"enable_gds"` // Enable Graph Data Science library } // DefaultConfig returns the default configuration func DefaultConfig() *Config { return &Config{ MaxChainLength: 5, MaxPathHops: 4, MaxNetworkSize: 20, MinNetworkSize: 3, DefaultResultLimit: 50, MaxChainDistanceKm: 500.0, MaxPathDistanceKm: 200.0, MinChainValue: 1000.0, MinNetworkValue: 5000.0, QueryTimeoutSeconds: 30, EnableGDS: false, // Default to false, enable if GDS is installed } } // Validate validates the configuration func (c *Config) Validate() error { if c.MaxChainLength < 1 { return ErrInvalidConfig } if c.MaxPathHops < 1 { return ErrInvalidConfig } if c.MaxNetworkSize < c.MinNetworkSize { return ErrInvalidConfig } if c.DefaultResultLimit < 1 { return ErrInvalidConfig } return nil }