Skip to content

Commit f81b13b

Browse files
committed
Update sampling
1 parent 40446bd commit f81b13b

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

model/sampling.go

+11-13
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ type SamplingStrategy struct {
2626
ISamplingStrategy ISamplingStrategy
2727
}
2828

29-
// supported sampling methods so far
29+
/*
30+
DELETION GRAPH SAMPLING METHODS
31+
*/
3032
type DeletionRandomNodeSampling struct{ IDeletionSamplingStrategy }
3133
type DeletionRandomNodeNeighbourSampling struct{ IDeletionSamplingStrategy }
3234
type DeletionInclusiveRandomNodeNeighbourSampling struct{ IDeletionSamplingStrategy }
@@ -219,6 +221,10 @@ func (strategy *DeletionSamplingStrategy) Sample(graph *UndirectedGraph, sampled
219221
return ng, nil
220222
}
221223

224+
/*
225+
PRESERVATION GRAPH SAMPLING METHODS
226+
*/
227+
222228
type PreservationRandomNodeSampling struct{ ISamplingStrategy }
223229
type PreservationRandomNodeNeighbourSampling struct{ ISamplingStrategy }
224230
type PreservationInclusiveRandomNodeNeighbourSampling struct{ ISamplingStrategy }
@@ -233,12 +239,6 @@ type PreservationRandomWalkWithJumpSampling struct{ ISamplingStrategy }
233239
type PreservationRandomWalkWithRestartSampling struct{ ISamplingStrategy }
234240
type PreservationTopKEdgeSampling struct{ ISamplingStrategy }
235241

236-
type PreservationInducedRandomEdgeSampling struct{ ISamplingStrategy }
237-
type PreservationSnowballSampling struct{ ISamplingStrategy }
238-
type PreservationForestFireSampling struct{ ISamplingStrategy }
239-
type PreservationFrontierSampling struct{ ISamplingStrategy }
240-
type PreservationExpansionSampling struct{ ISamplingStrategy }
241-
242242
func (strategy *PreservationRandomNodeSampling) Sample(g UndirectedGraph, sampledGraphSizeRatio float32) (UndirectedGraph, error) {
243243
ng := UndirectedGraph{
244244
Nodes: make(map[Node]bool),
@@ -556,6 +556,10 @@ func (strategy *PreservationTopKEdgeSampling) Sample(g UndirectedGraph, sampledG
556556
return ng, nil
557557
}
558558

559+
/*
560+
CONTRACTION GRAPH SAMPLING METHODS
561+
*/
562+
559563
type ContractionRandomNodeSampling struct{ ISamplingStrategy }
560564
type ContractionRandomNodeNeighbourSampling struct{ ISamplingStrategy }
561565
type ContractionInclusiveRandomNodeNeighbourSampling struct{ ISamplingStrategy }
@@ -568,12 +572,6 @@ type ContractionRandomWalkWithRestartSampling struct{ ISamplingStrategy }
568572
type ContractionRandomWalkWithJumpSampling struct{ ISamplingStrategy }
569573

570574
type ContractionPageRankNodeSampling struct{ ISamplingStrategy }
571-
type ContractionInducedRandomEdgeSampling struct{ ISamplingStrategy }
572-
573-
type ContractionSnowballSampling struct{ ISamplingStrategy }
574-
type ContractionForestFireSampling struct{ ISamplingStrategy }
575-
type ContractionFrontierSampling struct{ ISamplingStrategy }
576-
type ContractionExpansionSampling struct{ ISamplingStrategy }
577575

578576
func (strategy *ContractionRandomNodeSampling) Sample(graph UndirectedGraph, sampledGraphSizeRatio float32) (UndirectedGraph, error) {
579577
ng := UndirectedGraph{}

0 commit comments

Comments
 (0)